btrfs: do proper error handling in create_reloc_root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 12 Mar 2021 20:25:14 +0000 (15:25 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:20 +0000 (17:25 +0200)
commit84c50ba5214c2f3c1be4a931d521ec19f55dfdc8
tree5ec9dd686bc5aa3d842a44180d887826b538e160
parent00bb36a0e76ab7e94bdd70d561baf25f9bc1415d
btrfs: do proper error handling in create_reloc_root

We do memory allocations here, read blocks from disk, all sorts of
operations that could easily fail at any given point.  Instead of
panicing the box, simply return the error back up the chain, all callers
at this point have proper error handling.

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