From: Zhao Lei Date: Wed, 22 Jul 2015 05:14:47 +0000 (+0800) Subject: btrfs: Load only necessary csums into list in scrub X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe8cf654b1ccf7f0b49cc0de9e6ad8a56529e384;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Chris Mason --- 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;