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: Qu Wenruo <wqu@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Родитель
bbae13f8ab
Коммит
592fbcd50c
|
@ -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,
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче