]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do not BUG_ON() on failure to reserve metadata for delayed item
authorFilipe Manana <fdmanana@suse.com>
Tue, 31 May 2022 15:06:41 +0000 (16:06 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:44:35 +0000 (17:44 +0200)
commit95e55f818b5b330934b75e15693435c9660c48f5
tree35b6c8428a4be346aa15f05da441988fb6f05e81
parent209e921b732acaefd0932270c5a082e909b10509
btrfs: do not BUG_ON() on failure to reserve metadata for delayed item

At btrfs_insert_delayed_dir_index(), we don't expect the metadata
reservation for the delayed dir index item insertion to fail, because the
caller is supposed to have reserved 1 unit of metadata space for that.
All callers are able to deal with an error in case that happens, so there
is no need for something so drastic as a BUG_ON() in case of failure.
Instead just emit a warning, so that's easily noticed during development
(fstests in particular), and return the error to the caller.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-inode.c