diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-07-22 13:14:47 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-08-09 07:07:11 -0700 |
commit | fe8cf654b1ccf7f0b49cc0de9e6ad8a56529e384 (patch) | |
tree | 734e6916b0662d77a1e3a60ffb3b08418e16231a /fs/btrfs | |
parent | a0dd59de3c73fbb3b738eaf333732f2f27254a2c (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/scrub.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 185595a7be10..b03dd10e1d25 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -3254,9 +3254,11 @@ again: &extent_dev, &extent_mirror_num); - ret = btrfs_lookup_csums_range(csum_root, logical, - logical + map->stripe_len - 1, - &sctx->csum_list, 1); + ret = btrfs_lookup_csums_range(csum_root, + extent_logical, + extent_logical + + extent_len - 1, + &sctx->csum_list, 1); if (ret) goto out; |