]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_scrub: actually iterate all the bulkstat records
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:21:42 +0000 (10:21 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:15:56 +0000 (09:15 -0800)
commitc053cf87f9509ec82eac04221f093c3a41d6e4e3
tree1d4166721e1d5565e1a95cb1523866879906ef8d
parentb95546f18e6bfbe477e0bd3c726c9ae8a6c9f2ff
xfs_scrub: actually iterate all the bulkstat records

In scan_ag_bulkstat, we have a for loop that iterates all the
xfs_bulkstat records in breq->bulkstat.  The loop condition test should
test against the array length, not the number of bits set in an
unrelated data structure.  If ocount > xi_alloccount then we miss some
inodes; if ocount < xi_alloccount then we've walked off the end of the
array.

Cc: <linux-xfs@vger.kernel.org> # v5.18.0
Fixes: 245c72a6eeb720 ("xfs_scrub: balance inode chunk scan across CPUs")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/inodes.c