mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
btrfs: check record_root_in_trans related failures in select_reloc_root
We will record the fs root or the reloc root in the trans in select_reloc_root. These will actually return errors in the following patches, so check their return value here and return it up the stack. 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:
parent
8ee66afe99
commit
92de551b83
1 changed files with 7 additions and 2 deletions
|
@ -1988,6 +1988,7 @@ struct btrfs_root *select_reloc_root(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_backref_node *next;
|
struct btrfs_backref_node *next;
|
||||||
struct btrfs_root *root;
|
struct btrfs_root *root;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
int ret;
|
||||||
|
|
||||||
next = node;
|
next = node;
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -2023,11 +2024,15 @@ struct btrfs_root *select_reloc_root(struct btrfs_trans_handle *trans,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) {
|
if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) {
|
||||||
record_reloc_root_in_trans(trans, root);
|
ret = record_reloc_root_in_trans(trans, root);
|
||||||
|
if (ret)
|
||||||
|
return ERR_PTR(ret);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
btrfs_record_root_in_trans(trans, root);
|
ret = btrfs_record_root_in_trans(trans, root);
|
||||||
|
if (ret)
|
||||||
|
return ERR_PTR(ret);
|
||||||
root = root->reloc_root;
|
root = root->reloc_root;
|
||||||
|
|
||||||
if (next->new_bytenr != root->node->start) {
|
if (next->new_bytenr != root->node->start) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue