btrfs: Load only necessary csums into list in scrub
We need not load csum of whole strip in scrub because strip is trimed before use, it is to say, what we really need to calculate csum is data between [extent_logical, extent_len). This patch changed to use above segment for btrfs_lookup_csums_range() in scrub_stripe() Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
a0dd59de3c
commit
fe8cf654b1
@ -3254,9 +3254,11 @@ again:
|
|||||||
&extent_dev,
|
&extent_dev,
|
||||||
&extent_mirror_num);
|
&extent_mirror_num);
|
||||||
|
|
||||||
ret = btrfs_lookup_csums_range(csum_root, logical,
|
ret = btrfs_lookup_csums_range(csum_root,
|
||||||
logical + map->stripe_len - 1,
|
extent_logical,
|
||||||
&sctx->csum_list, 1);
|
extent_logical +
|
||||||
|
extent_len - 1,
|
||||||
|
&sctx->csum_list, 1);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user