@@ -349,6 +349,7 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
if (btrfs_buffer_uptodate(eb, parent_transid))
return eb;
+ num_copies = btrfs_num_copies(fs_info, eb->start, eb->len);
while (1) {
ret = read_whole_eb(fs_info, eb, mirror_num);
if (ret == 0 && csum_tree_block(fs_info, eb, 1) == 0 &&
@@ -376,7 +377,6 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
ret = -EIO;
break;
}
- num_copies = btrfs_num_copies(fs_info, eb->start, eb->len);
if (num_copies == 1) {
ignore = 1;
continue;
btrfs_num_copies really only needs to be called once, so move it out of the verification loop in read_tree_block(). Signed-off-by: Qu Wenruo <wqu@suse.com> --- disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)