diff mbox series

[6/8] punch: skip fpunch tests when op length not congruent with file allocation unit

Message ID 165826667021.3249494.7465600803977165173.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: check file block congruency of file range operations | expand

Commit Message

Darrick J. Wong July 19, 2022, 9:37 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Skip the generic fpunch tests on a file when the file's allocation unit
size is not congruent with the proposed testing operations.

This can be the case when we're testing reflink and fallocate on the XFS
realtime device.  For those configurations, the file allocation unit is
a realtime extent, which can be any integer multiple of the block size.
If the request length isn't an exact multiple of the allocation unit
size, reflink and fallocate will fail due to alignment issues, so
there's no point in running these tests.

Assuming this edgecase configuration of an edgecase feature is
vanishingly rare, let's just _notrun the tests instead of rewriting a
ton of tests to do their integrity checking by hand.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/punch |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/common/punch b/common/punch
index 4d16b898..47a29c92 100644
--- a/common/punch
+++ b/common/punch
@@ -250,6 +250,7 @@  _test_generic_punch()
 	_8k="$((multiple * 8))k"
 	_12k="$((multiple * 12))k"
 	_20k="$((multiple * 20))k"
+	_require_congruent_file_oplen "$(dirname "$testfile")" $((multiple * 4096))
 
 	# initial test state must be defined, otherwise the first test can fail
 	# due ot stale file state left from previous tests.