summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-03-12 21:25:07 +0100
committerDavid Sterba <dsterba@suse.com>2021-04-19 17:25:20 +0200
commitd18c7bd95c3d1adf5de385acc8c0bdb64b1a8d68 (patch)
tree76eb234223a3d53600dac53c71ad9c32ce0834aa /fs/btrfs/relocation.c
parentbtrfs: handle btrfs_record_root_in_trans failure in create_subvol (diff)
downloadlinux-d18c7bd95c3d1adf5de385acc8c0bdb64b1a8d68.tar.xz
linux-d18c7bd95c3d1adf5de385acc8c0bdb64b1a8d68.zip
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/relocation.c')
-rw-r--r--fs/btrfs/relocation.c4
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);