]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_scrub: don't double-scan inodes during phase 3
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:21:43 +0000 (10:21 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:15:56 +0000 (09:15 -0800)
commit174298876add91c2b3d414c6c1cd4b09a47a0517
tree6ca5b44fcddd1f879ddfd81859af5df0af3305d1
parentc053cf87f9509ec82eac04221f093c3a41d6e4e3
xfs_scrub: don't double-scan inodes during phase 3

The bulkstat ioctl only allows us to specify the starting inode number
and the length of the bulkstat array.  It is possible that a bulkstat
request for {startino = 30, icount = 10} will return stat data for inode
50.  For most bulkstat users this is ok because they're marching
linearly across all inodes in the filesystem.

Unfortunately for scrub phase 3 this is undesirable because we only want
the inodes that belong to a specific inobt record because we need to
know about inodes that are marked as allocated but are too corrupt to
appear in the bulkstat output.  Another worker will process the inobt
record(s) that corresponds to the extra inodes, which means we can
double-scan some inodes.

Therefore, bulkstat_for_inumbers should trim out inodes that don't
correspond to the inumbers record that it is given.

Cc: <linux-xfs@vger.kernel.org> # v5.3.0
Fixes: e3724c8b82a320 ("xfs_scrub: refactor xfs_iterate_inodes_range_check")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/inodes.c