]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: convert BUG_ON()'s in select_reloc_root() to proper errors
authorJosef Bacik <josef@toxicpanda.com>
Fri, 12 Mar 2021 20:24:59 +0000 (15:24 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 6 Apr 2021 17:16:08 +0000 (19:16 +0200)
commitb76ba13d248b970f272bfb3ebd06e3cad316aa6d
treec0563ec299a5dfe70426c7f62faa82331b901fa3
parent1a329a884c9ef68cfb3eba97d69eae6cbb7cd3bf
btrfs: convert BUG_ON()'s in select_reloc_root() to proper errors

We have several BUG_ON()'s in select_reloc_root() that can be tripped if
there is an extent tree corruption.  Convert these to ASSERT()'s, because
if we hit it during testing it really is bad, or could indicate a
problem with the backref walking code.

However if users hit these problems it generally indicates corruption,
I've hit a few machines in the fleet that trip over these with clearly
corrupted extent trees, so be nice and print out an error message and
return an error instead of bringing the whole box down.

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