• Filipe Manana's avatar
    btrfs: do not BUG_ON() on tree mod log failures at btrfs_del_ptr() · 751a2761
    Filipe Manana authored
    At btrfs_del_ptr(), instead of doing a BUG_ON() in case we fail to record
    tree mod log operations, do a transaction abort and return the error to
    the callers. There's really no need for the BUG_ON() as we can release all
    resources in the context of all callers, and we have to abort because other
    future tree searches that use the tree mod log (btrfs_search_old_slot())
    may get inconsistent results if other operations modify the tree after
    that failure and before the tree mod log based search.
    
    This implies btrfs_del_ptr() return an int instead of void, and making all
    callers check for returned errors.
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    751a2761
ctree.h 22.6 KB