]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: replace the BUG_ON in btrfs_del_root_ref with proper error handling
authorQu Wenruo <wqu@suse.com>
Wed, 1 Dec 2021 11:56:17 +0000 (19:56 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 8 Dec 2021 14:45:27 +0000 (15:45 +0100)
commit1efedfdf7e61cecbb7102d2d176262e1da17c565
tree700c3fbb2343f9181eab6ea2e78665b59f4619f6
parent9d6ab3a4f46ef5ee5d1285c8798b7cc7b11f0480
btrfs: replace the BUG_ON in btrfs_del_root_ref with proper error handling

I hit the BUG_ON() with generic/475 test case, and to my surprise, all
callers of btrfs_del_root_ref() are already aborting transaction, thus
there is not need for such BUG_ON(), just go to @out label and caller
will properly handle the error.

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/root-tree.c