OSDN Git Service

btrfs: do proper error handling in merge_reloc_roots
authorJosef Bacik <josef@toxicpanda.com>
Fri, 12 Mar 2021 20:25:33 +0000 (15:25 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:22 +0000 (17:25 +0200)
commit24213fa46c7080c31d79aa2e3e2f0d9480cab700
treec5b5630cc1646c40e1e963e6526af356ab562086
parent8717cf440db670ba87596d8f5f6660d2a94f4401
btrfs: do proper error handling in merge_reloc_roots

We have a BUG_ON() if we get an error back from btrfs_get_fs_root().
This honestly should never fail, as at this point we have a solid
coordination of fs root to reloc root, and these roots will all be in
memory.  But in the name of killing BUG_ON()'s remove these and handle
the error condition properly, ASSERT()'ing for developers.

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