From: Zhao Lei <[email protected]>

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 <[email protected]>
---
 fs/btrfs/scrub.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 7f56603..d72e8e1 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3251,9 +3251,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;
 
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to