diff options
author | Josef Bacik | 2021-03-12 15:25:07 -0500 |
---|---|---|
committer | David Sterba | 2021-04-19 17:25:20 +0200 |
commit | d18c7bd95c3d1adf5de385acc8c0bdb64b1a8d68 (patch) | |
tree | 76eb234223a3d53600dac53c71ad9c32ce0834aa /fs/btrfs | |
parent | 221581e485751811db3b43148177be2a0bdb2f3c (diff) |
btrfs: handle btrfs_record_root_in_trans failure in relocate_tree_block
btrfs_record_root_in_trans will return errors in the future, so handle
the error properly in relocate_tree_block.
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/relocation.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 1abe7565cf05..7966950d7f51 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2548,7 +2548,9 @@ static int relocate_tree_block(struct btrfs_trans_handle *trans, ret = -EUCLEAN; goto out; } - btrfs_record_root_in_trans(trans, root); + ret = btrfs_record_root_in_trans(trans, root); + if (ret) + goto out; root = root->reloc_root; node->new_bytenr = root->node->start; btrfs_put_root(node->root); |