From: Darrick J. Wong Date: Wed, 24 Jun 2026 18:16:35 +0000 (-0700) Subject: xfs_scrub: account only data extent tail after an overlap X-Git-Tag: v7.1.0~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=243048f90dd45bb8ff53cb9c8f0bddbe07e9dbb4;p=xfsprogs-dev.git xfs_scrub: account only data extent tail after an overlap Codex points out that the fsmap overlap handling in phase7 isn't quite right -- if we already saw part of the current fsmapping, we should *subtract* the overlap, not set the length to it! Fix that. Cc: linux-xfs@vger.kernel.org # v4.15.0 Fixes: 698c6c7cb8ba75 ("xfs_scrub: check summary counters") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/scrub/phase7.c b/scrub/phase7.c index 3b765931..4a25c521 100644 --- a/scrub/phase7.c +++ b/scrub/phase7.c @@ -127,7 +127,7 @@ count_block_summary( if (counts->next_phys >= fsmap->fmr_physical + len) return 0; else if (counts->next_phys > fsmap->fmr_physical) - len = counts->next_phys - fsmap->fmr_physical; + len -= counts->next_phys - fsmap->fmr_physical; counts->dbytes += len; counts->next_phys = fsmap->fmr_physical + fsmap->fmr_length; break;