Commit 592fbcd5 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: do proper error handling in btrfs_update_reloc_root

We call btrfs_update_root in btrfs_update_reloc_root, which can fail for
all sorts of reasons, including IO errors.  Instead of panicing the box
lets return the error, now that all callers properly handle those
errors.
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent bbae13f8
...@@ -903,7 +903,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, ...@@ -903,7 +903,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
int ret; int ret;
if (!have_reloc_root(root)) if (!have_reloc_root(root))
goto out; return 0;
reloc_root = root->reloc_root; reloc_root = root->reloc_root;
root_item = &reloc_root->root_item; root_item = &reloc_root->root_item;
...@@ -936,10 +936,8 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, ...@@ -936,10 +936,8 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
ret = btrfs_update_root(trans, fs_info->tree_root, ret = btrfs_update_root(trans, fs_info->tree_root,
&reloc_root->root_key, root_item); &reloc_root->root_key, root_item);
BUG_ON(ret);
btrfs_put_root(reloc_root); btrfs_put_root(reloc_root);
out: return ret;
return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment