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>
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;