diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/relocation.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index d338df405e72..704a1b8d2a2b 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -2875,7 +2875,7 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, | |||
2875 | path = btrfs_alloc_path(); | 2875 | path = btrfs_alloc_path(); |
2876 | if (!path) { | 2876 | if (!path) { |
2877 | err = -ENOMEM; | 2877 | err = -ENOMEM; |
2878 | goto out_path; | 2878 | goto out_free_blocks; |
2879 | } | 2879 | } |
2880 | 2880 | ||
2881 | rb_node = rb_first(blocks); | 2881 | rb_node = rb_first(blocks); |
@@ -2889,8 +2889,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, | |||
2889 | rb_node = rb_first(blocks); | 2889 | rb_node = rb_first(blocks); |
2890 | while (rb_node) { | 2890 | while (rb_node) { |
2891 | block = rb_entry(rb_node, struct tree_block, rb_node); | 2891 | block = rb_entry(rb_node, struct tree_block, rb_node); |
2892 | if (!block->key_ready) | 2892 | if (!block->key_ready) { |
2893 | get_tree_block_key(rc, block); | 2893 | err = get_tree_block_key(rc, block); |
2894 | if (err) | ||
2895 | goto out_free_path; | ||
2896 | } | ||
2894 | rb_node = rb_next(rb_node); | 2897 | rb_node = rb_next(rb_node); |
2895 | } | 2898 | } |
2896 | 2899 | ||
@@ -2917,8 +2920,9 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, | |||
2917 | out: | 2920 | out: |
2918 | err = finish_pending_nodes(trans, rc, path, err); | 2921 | err = finish_pending_nodes(trans, rc, path, err); |
2919 | 2922 | ||
2923 | out_free_path: | ||
2920 | btrfs_free_path(path); | 2924 | btrfs_free_path(path); |
2921 | out_path: | 2925 | out_free_blocks: |
2922 | free_block_list(blocks); | 2926 | free_block_list(blocks); |
2923 | return err; | 2927 | return err; |
2924 | } | 2928 | } |