]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
xfs/113: fix failure to corrupt the entire directory
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Nov 2024 01:21:18 +0000 (17:21 -0800)
committerZorro Lang <zlang@kernel.org>
Thu, 28 Nov 2024 13:39:49 +0000 (21:39 +0800)
commitfa95cde52dcd7dcc30b9968da68741f8b16a6e43
tree3624c8c257b12120687623c83ae90235f80b4727
parente21e278065bf3e8ab168c5d901a07dfa4f2705fc
xfs/113: fix failure to corrupt the entire directory

This test tries to corrupt the data blocks of a directory, but it
doesn't take into account the fact that __populate_check_xfs_dir can
remove enough entries to cause sparse holes in the directory.  If that
happens, this "file data block is unmapped" logic will cause the
corruption loop to exit early.  Then we can add to the directory, which
causes the test to fail.

Instead, create a list of mappable dir block offsets, and run 100
corruptions at a time to reduce the amount of time we spend initializing
xfs_db.  This fixes the regressions that I see with 32k/64k block sizes.

Cc: fstests@vger.kernel.org # v2022.05.01
Fixes: c8e6dbc8812653 ("xfs: test directory metadata corruption checking and repair")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/113