]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: fix confusing rt space units in the duplicate detection code
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 23:07:28 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:22 +0000 (14:06 -0700)
commitb64874dba74d529d048b931c80d16c37bb0ff6e9
treef900b709da0b3b85d0774e71ca4e8f43a2cfb08c
parent94f4f0a7321d52edaa998367cccbe4dd16f1053a
xfs_repair: fix confusing rt space units in the duplicate detection code

Christoph Hellwig stumbled over the crosslinked file data detection code
in xfs_repair.  While trying to make sense of his fixpatch, I realized
that the variable names and unit types are very misleading.

The rt dup tree builder inserts records in units of realtime extents.
One query of the rt dup tree passes in a realtime extent number, but one
of them does not.  Confusingly, all the variable names have "block" even
though they really mean "extent".  This makes a real difference for
rextsize > 1 filesystems, though given the lack of complaints I'm
guessing there aren't many users.

Clean up this whole mess by fixing the variable names of the duplicates
tree and the state array to reflect the units that are stored in the
data structure, and fix the buggy query code.  Later on in this patchset
we'll fix the variable types too.

This seems to have been broken since before the start of the git repo.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
repair/incore.c
repair/incore.h
repair/incore_ext.c
repair/phase4.c