]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: account only data extent tail after an overlap
authorDarrick J. Wong <djwong@kernel.org>
Wed, 24 Jun 2026 18:16:35 +0000 (11:16 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 25 Jun 2026 13:42:53 +0000 (15:42 +0200)
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" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase7.c

index 3b765931a304a9ac3c6942844162abfc6997e82a..4a25c521fa0c76aa1c1abb2000a25268b2bfebd2 100644 (file)
@@ -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;