diff mbox series

[1/6] generic/092: skip test if file allocation unit isn't aligned

Message ID 166500903863.886939.16469306626224157289.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: random fixes for v2022.09.25 | expand

Commit Message

Darrick J. Wong Oct. 5, 2022, 10:30 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

This test exercises allocation behavior when truncating a preallocated
file down to 5M and then up to 7M.  If those two sizes aren't aligned
with the file allocation unit length, then the FIEMAP output will show
blocks beyond EOF.  That will cause trouble with the golden output, so
skip this test if that will be the case.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
---
 tests/generic/092 |    6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/tests/generic/092 b/tests/generic/092
index 505e0ec84f..d7c93ca792 100755
--- a/tests/generic/092
+++ b/tests/generic/092
@@ -28,6 +28,12 @@  _require_test
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fiemap"
 
+# If the truncation sizes (5M/7M) aren't aligned with the file allocation unit
+# length, then the FIEMAP output will show blocks beyond EOF.  That will cause
+# trouble with the golden output, so skip this test if that will be the case.
+_require_congruent_file_oplen $TEST_DIR $((5 * 1048576))
+_require_congruent_file_oplen $TEST_DIR $((7 * 1048576))
+
 # First test to make sure that truncating at i_size trims the preallocated bit
 # past i_size
 $XFS_IO_PROG -f -c "falloc -k 0 10M" -c "pwrite 0 5M" -c "truncate 5M"\