]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: do not panic in __add_reloc_root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 12 Mar 2021 20:25:30 +0000 (15:25 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 6 Apr 2021 19:07:07 +0000 (21:07 +0200)
commitafdc3b06b892e2956238acfb39550d132f39ff80
tree430f1309e2e03c1f1dc00a776bc7c68ec04ce2da
parent13a31d22dfff7f8e2a7465ff2d319c35523107d0
btrfs: do not panic in __add_reloc_root

If we have a duplicate entry for a reloc root then we could have fs
corruption that resulted in a double allocation.  Since this shouldn't
happen unless there is corruption, add an ASSERT(ret != -EEXIST) to all
of the callers of __add_reloc_root() to catch any logic mistakes for
developers, otherwise normal error handling will happen for normal
users.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c