aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index d7506325b024..95bc40ae358d 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -1813,8 +1813,7 @@ again:
1813 break; 1813 break;
1814 } 1814 }
1815 1815
1816 eb = read_tree_block(dest, old_bytenr, blocksize, 1816 eb = read_tree_block(dest, old_bytenr, old_ptr_gen);
1817 old_ptr_gen);
1818 if (!eb || !extent_buffer_uptodate(eb)) { 1817 if (!eb || !extent_buffer_uptodate(eb)) {
1819 ret = (!eb) ? -ENOMEM : -EIO; 1818 ret = (!eb) ? -ENOMEM : -EIO;
1820 free_extent_buffer(eb); 1819 free_extent_buffer(eb);
@@ -1944,7 +1943,6 @@ int walk_down_reloc_tree(struct btrfs_root *root, struct btrfs_path *path,
1944 u64 bytenr; 1943 u64 bytenr;
1945 u64 ptr_gen = 0; 1944 u64 ptr_gen = 0;
1946 u64 last_snapshot; 1945 u64 last_snapshot;
1947 u32 blocksize;
1948 u32 nritems; 1946 u32 nritems;
1949 1947
1950 last_snapshot = btrfs_root_last_snapshot(&root->root_item); 1948 last_snapshot = btrfs_root_last_snapshot(&root->root_item);
@@ -1970,8 +1968,7 @@ int walk_down_reloc_tree(struct btrfs_root *root, struct btrfs_path *path,
1970 } 1968 }
1971 1969
1972 bytenr = btrfs_node_blockptr(eb, path->slots[i]); 1970 bytenr = btrfs_node_blockptr(eb, path->slots[i]);
1973 blocksize = root->nodesize; 1971 eb = read_tree_block(root, bytenr, ptr_gen);
1974 eb = read_tree_block(root, bytenr, blocksize, ptr_gen);
1975 if (!eb || !extent_buffer_uptodate(eb)) { 1972 if (!eb || !extent_buffer_uptodate(eb)) {
1976 free_extent_buffer(eb); 1973 free_extent_buffer(eb);
1977 return -EIO; 1974 return -EIO;
@@ -2680,7 +2677,7 @@ static int do_relocation(struct btrfs_trans_handle *trans,
2680 2677
2681 blocksize = root->nodesize; 2678 blocksize = root->nodesize;
2682 generation = btrfs_node_ptr_generation(upper->eb, slot); 2679 generation = btrfs_node_ptr_generation(upper->eb, slot);
2683 eb = read_tree_block(root, bytenr, blocksize, generation); 2680 eb = read_tree_block(root, bytenr, generation);
2684 if (!eb || !extent_buffer_uptodate(eb)) { 2681 if (!eb || !extent_buffer_uptodate(eb)) {
2685 free_extent_buffer(eb); 2682 free_extent_buffer(eb);
2686 err = -EIO; 2683 err = -EIO;
@@ -2842,7 +2839,7 @@ static int get_tree_block_key(struct reloc_control *rc,
2842 2839
2843 BUG_ON(block->key_ready); 2840 BUG_ON(block->key_ready);
2844 eb = read_tree_block(rc->extent_root, block->bytenr, 2841 eb = read_tree_block(rc->extent_root, block->bytenr,
2845 block->key.objectid, block->key.offset); 2842 block->key.offset);
2846 if (!eb || !extent_buffer_uptodate(eb)) { 2843 if (!eb || !extent_buffer_uptodate(eb)) {
2847 free_extent_buffer(eb); 2844 free_extent_buffer(eb);
2848 return -EIO; 2845 return -EIO;