From: Josef Bacik Date: Fri, 12 Mar 2021 20:25:07 +0000 (-0500) Subject: btrfs: handle btrfs_record_root_in_trans failure in relocate_tree_block X-Git-Tag: io_uring-5.13-2021-05-07~74^2~41 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d18c7bd95c3d1adf5de385acc8c0bdb64b1a8d68;p=linux-block.git 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 Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- 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);