All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2 0/8] fstests: check file block congruency of file range operations
@ 2022-07-19 21:37 Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 1/8] misc: use _get_file_block_size for block (re)mapping tests Darrick J. Wong
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

Hi all,

I started running fstests with XFS filesystems that don't have the usual
file geometry characteristics -- block sizes larger than 4k, realtime
filesystems with extent sizes that aren't a power of two, etc.  What I
found is that many file operation tests (fallocate, reflink, etc.) that
operate on disk blocks assume that aligning the arguments to 64k is
sufficient to avoid EINVAL.  Unfortunately, this just means that these
tests fail left and right on realtime filesystems where the file
allocation unit is large (~2MB, anyone?) or a weird number (28K).

Add a predicate to all of these tests so that we can _notrun them if
they make assumptions about file size /and/ encode something (usually
file hashes) in the golden output that mean we can't easily accomodate
these corner cases without redesigning each test.

v2: skip congruency tests for network filesystems, be more consistent about
    TEST_DIR in the arguments, fix a bug in a helper's callsite reported by
    Zorro.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=check-blocksize-congruency
---
 common/filter     |    4 ++--
 common/punch      |    3 ++-
 common/rc         |   28 +++++++++++++++++++++++++++-
 tests/generic/017 |    2 +-
 tests/generic/031 |    1 +
 tests/generic/064 |    2 +-
 tests/generic/116 |    1 +
 tests/generic/118 |    1 +
 tests/generic/119 |    1 +
 tests/generic/121 |    1 +
 tests/generic/122 |    1 +
 tests/generic/134 |    1 +
 tests/generic/136 |    1 +
 tests/generic/137 |    1 +
 tests/generic/144 |    1 +
 tests/generic/149 |    1 +
 tests/generic/153 |    2 +-
 tests/generic/158 |    2 +-
 tests/generic/162 |    1 +
 tests/generic/163 |    1 +
 tests/generic/164 |    1 +
 tests/generic/165 |    1 +
 tests/generic/168 |    1 +
 tests/generic/170 |    1 +
 tests/generic/181 |    1 +
 tests/generic/183 |    1 +
 tests/generic/185 |    1 +
 tests/generic/186 |    1 +
 tests/generic/187 |    1 +
 tests/generic/188 |    1 +
 tests/generic/189 |    1 +
 tests/generic/190 |    1 +
 tests/generic/191 |    1 +
 tests/generic/194 |    1 +
 tests/generic/195 |    1 +
 tests/generic/196 |    1 +
 tests/generic/197 |    1 +
 tests/generic/199 |    1 +
 tests/generic/200 |    1 +
 tests/generic/201 |    1 +
 tests/generic/284 |    1 +
 tests/generic/287 |    1 +
 tests/generic/289 |    1 +
 tests/generic/290 |    1 +
 tests/generic/291 |    1 +
 tests/generic/292 |    1 +
 tests/generic/293 |    1 +
 tests/generic/295 |    1 +
 tests/generic/352 |    1 +
 tests/generic/358 |    1 +
 tests/generic/359 |    1 +
 tests/generic/372 |    1 +
 tests/generic/404 |    2 +-
 tests/generic/414 |    1 +
 tests/generic/483 |    4 ++++
 tests/generic/495 |    4 ++++
 tests/generic/501 |    1 +
 tests/generic/503 |    4 ++++
 tests/generic/515 |    1 +
 tests/generic/516 |    1 +
 tests/generic/540 |    1 +
 tests/generic/541 |    1 +
 tests/generic/542 |    1 +
 tests/generic/543 |    1 +
 tests/generic/544 |    1 +
 tests/generic/546 |    1 +
 tests/generic/578 |    1 +
 tests/generic/588 |    2 ++
 tests/generic/673 |    1 +
 tests/generic/674 |    1 +
 tests/generic/675 |    1 +
 tests/generic/677 |    4 ++++
 tests/generic/683 |    1 +
 tests/generic/684 |    1 +
 tests/generic/685 |    1 +
 tests/generic/686 |    1 +
 tests/generic/687 |    1 +
 tests/generic/688 |    1 +
 tests/xfs/069     |    1 +
 tests/xfs/114     |    2 ++
 tests/xfs/166     |    4 ++++
 tests/xfs/180     |    1 +
 tests/xfs/182     |    1 +
 tests/xfs/184     |    1 +
 tests/xfs/192     |    1 +
 tests/xfs/193     |    1 +
 tests/xfs/198     |    1 +
 tests/xfs/200     |    1 +
 tests/xfs/203     |    4 ++++
 tests/xfs/204     |    1 +
 tests/xfs/208     |    1 +
 tests/xfs/209     |    1 +
 tests/xfs/210     |    1 +
 tests/xfs/211     |    1 +
 tests/xfs/212     |    1 +
 tests/xfs/215     |    1 +
 tests/xfs/218     |    1 +
 tests/xfs/219     |    1 +
 tests/xfs/221     |    1 +
 tests/xfs/223     |    1 +
 tests/xfs/224     |    1 +
 tests/xfs/225     |    1 +
 tests/xfs/226     |    1 +
 tests/xfs/228     |    1 +
 tests/xfs/230     |    1 +
 tests/xfs/231     |    1 +
 tests/xfs/232     |    1 +
 tests/xfs/237     |    1 +
 tests/xfs/239     |    1 +
 tests/xfs/240     |    1 +
 tests/xfs/241     |    1 +
 tests/xfs/248     |    1 +
 tests/xfs/249     |    1 +
 tests/xfs/251     |    1 +
 tests/xfs/254     |    1 +
 tests/xfs/255     |    1 +
 tests/xfs/256     |    1 +
 tests/xfs/257     |    1 +
 tests/xfs/258     |    1 +
 tests/xfs/280     |    1 +
 tests/xfs/312     |    1 +
 tests/xfs/315     |    1 +
 tests/xfs/322     |    1 +
 tests/xfs/326     |    1 +
 tests/xfs/329     |    1 +
 tests/xfs/346     |    1 +
 tests/xfs/347     |    1 +
 tests/xfs/436     |    1 +
 tests/xfs/507     |    3 +++
 tests/xfs/537     |    2 +-
 130 files changed, 180 insertions(+), 10 deletions(-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/8] misc: use _get_file_block_size for block (re)mapping tests
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 2/8] misc: skip remap/fallocate tests when op length not congruent with file allocation unit Darrick J. Wong
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

From: Darrick J. Wong <djwong@kernel.org>

Tests that exercise block remapping functionality such as reflink,
hole punching, fcollapse, and finsert all require the input parameters
to be aligned to allocation unit size for regular files.  This could be
different from the fundamental filesystem block size (think ext4
bigalloc or xfs realtime), so use the appropriate function here.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
---
 common/rc         |    2 +-
 tests/generic/017 |    2 +-
 tests/generic/064 |    2 +-
 tests/generic/158 |    2 +-
 tests/xfs/537     |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/common/rc b/common/rc
index d5e6764c..5bac0355 100644
--- a/common/rc
+++ b/common/rc
@@ -2626,7 +2626,7 @@ _require_xfs_io_command()
 		param_checked="$param"
 		;;
 	"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" | "funshare")
-		local blocksize=$(_get_block_size $TEST_DIR)
+		local blocksize=$(_get_file_block_size $TEST_DIR)
 		testio=`$XFS_IO_PROG -F -f -c "pwrite 0 $((5 * $blocksize))" \
 			-c "fsync" -c "$command $blocksize $((2 * $blocksize))" \
 			$testfile 2>&1`
diff --git a/tests/generic/017 b/tests/generic/017
index 4b6acace..12c486d1 100755
--- a/tests/generic/017
+++ b/tests/generic/017
@@ -29,7 +29,7 @@ _scratch_mount
 testfile=$SCRATCH_MNT/$seq.$$
 BLOCKS=10240
 
-BSIZE=`_get_block_size $SCRATCH_MNT`
+BSIZE=`_get_file_block_size $SCRATCH_MNT`
 
 length=$(($BLOCKS * $BSIZE))
 
diff --git a/tests/generic/064 b/tests/generic/064
index b7d7fa4b..3b32fa1b 100755
--- a/tests/generic/064
+++ b/tests/generic/064
@@ -29,7 +29,7 @@ _scratch_mount
 src=$SCRATCH_MNT/testfile
 dest=$SCRATCH_MNT/testfile.dest
 BLOCKS=100
-BSIZE=`_get_block_size $SCRATCH_MNT`
+BSIZE=`_get_file_block_size $SCRATCH_MNT`
 length=$(($BLOCKS * $BSIZE))
 
 # Write file
diff --git a/tests/generic/158 b/tests/generic/158
index 649c75db..b9955265 100755
--- a/tests/generic/158
+++ b/tests/generic/158
@@ -38,7 +38,7 @@ testdir2=$SCRATCH_MNT/test-$seq
 mkdir $testdir2
 
 echo "Create the original files"
-blksz="$(_get_block_size $testdir1)"
+blksz="$(_get_file_block_size $testdir1)"
 blks=1000
 margin='7%'
 sz=$((blksz * blks))
diff --git a/tests/xfs/537 b/tests/xfs/537
index 7d7776f7..a31652cd 100755
--- a/tests/xfs/537
+++ b/tests/xfs/537
@@ -29,7 +29,7 @@ echo "Format and mount fs"
 _scratch_mkfs >> $seqres.full
 _scratch_mount >> $seqres.full
 
-bsize=$(_get_block_size $SCRATCH_MNT)
+bsize=$(_get_file_block_size $SCRATCH_MNT)
 
 srcfile=${SCRATCH_MNT}/srcfile
 donorfile=${SCRATCH_MNT}/donorfile


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/8] misc: skip remap/fallocate tests when op length not congruent with file allocation unit
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 1/8] misc: use _get_file_block_size for block (re)mapping tests Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 3/8] misc: skip extent size hint tests when hint " Darrick J. Wong
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

From: Darrick J. Wong <djwong@kernel.org>

Nearly all of the reflink and fpunch/fcollapse/finsert tests that I have
written assumed that it was ok to use 64k as the fundamental unit of
allocation.  This works fine for testing the XFS data device, since the
file allocation unit is always a power of two, and never larger than
64k.  Making this assumption allows those tests to encode md5sums in the
golden output for easy file data integrity checking.

Unfortunately, this isn't necessarily 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/rc         |   26 ++++++++++++++++++++++++++
 tests/generic/031 |    1 +
 tests/generic/116 |    1 +
 tests/generic/118 |    1 +
 tests/generic/119 |    1 +
 tests/generic/121 |    1 +
 tests/generic/122 |    1 +
 tests/generic/134 |    1 +
 tests/generic/136 |    1 +
 tests/generic/137 |    1 +
 tests/generic/144 |    1 +
 tests/generic/149 |    1 +
 tests/generic/162 |    1 +
 tests/generic/163 |    1 +
 tests/generic/164 |    1 +
 tests/generic/165 |    1 +
 tests/generic/168 |    1 +
 tests/generic/170 |    1 +
 tests/generic/181 |    1 +
 tests/generic/183 |    1 +
 tests/generic/185 |    1 +
 tests/generic/186 |    1 +
 tests/generic/187 |    1 +
 tests/generic/188 |    1 +
 tests/generic/189 |    1 +
 tests/generic/190 |    1 +
 tests/generic/191 |    1 +
 tests/generic/194 |    1 +
 tests/generic/195 |    1 +
 tests/generic/196 |    1 +
 tests/generic/197 |    1 +
 tests/generic/199 |    1 +
 tests/generic/200 |    1 +
 tests/generic/201 |    1 +
 tests/generic/284 |    1 +
 tests/generic/287 |    1 +
 tests/generic/289 |    1 +
 tests/generic/290 |    1 +
 tests/generic/291 |    1 +
 tests/generic/292 |    1 +
 tests/generic/293 |    1 +
 tests/generic/295 |    1 +
 tests/generic/352 |    1 +
 tests/generic/358 |    1 +
 tests/generic/359 |    1 +
 tests/generic/372 |    1 +
 tests/generic/414 |    1 +
 tests/generic/501 |    1 +
 tests/generic/515 |    1 +
 tests/generic/516 |    1 +
 tests/generic/540 |    1 +
 tests/generic/541 |    1 +
 tests/generic/542 |    1 +
 tests/generic/543 |    1 +
 tests/generic/544 |    1 +
 tests/generic/546 |    1 +
 tests/generic/578 |    1 +
 tests/generic/588 |    2 ++
 tests/generic/673 |    1 +
 tests/generic/674 |    1 +
 tests/generic/675 |    1 +
 tests/generic/683 |    1 +
 tests/generic/684 |    1 +
 tests/generic/685 |    1 +
 tests/generic/686 |    1 +
 tests/generic/687 |    1 +
 tests/generic/688 |    1 +
 tests/xfs/114     |    2 ++
 tests/xfs/208     |    1 +
 tests/xfs/210     |    1 +
 tests/xfs/212     |    1 +
 tests/xfs/215     |    1 +
 tests/xfs/218     |    1 +
 tests/xfs/219     |    1 +
 tests/xfs/221     |    1 +
 tests/xfs/223     |    1 +
 tests/xfs/224     |    1 +
 tests/xfs/225     |    1 +
 tests/xfs/226     |    1 +
 tests/xfs/228     |    1 +
 tests/xfs/230     |    1 +
 tests/xfs/248     |    1 +
 tests/xfs/249     |    1 +
 tests/xfs/251     |    1 +
 tests/xfs/254     |    1 +
 tests/xfs/255     |    1 +
 tests/xfs/256     |    1 +
 tests/xfs/257     |    1 +
 tests/xfs/258     |    1 +
 tests/xfs/280     |    1 +
 tests/xfs/312     |    1 +
 tests/xfs/315     |    1 +
 tests/xfs/322     |    1 +
 tests/xfs/329     |    1 +
 tests/xfs/436     |    1 +
 95 files changed, 122 insertions(+)


diff --git a/common/rc b/common/rc
index 5bac0355..f4469464 100644
--- a/common/rc
+++ b/common/rc
@@ -4557,6 +4557,32 @@ _get_file_block_size()
 	esac
 }
 
+# Given a file path and a byte length of a file operation under test, ensure
+# that the length is an integer multiple of the file's allocation unit size.
+# In other words, skip the test unless (oplen ≡ alloc_unit mod 0).  This is
+# intended for file remapping operations.
+_require_congruent_file_oplen()
+{
+	local file="$1"
+	local alloc_unit=$(_get_file_block_size "$file")
+	local oplen="$2"
+
+	case $FSTYP in
+	nfs*|cifs|9p|virtiofs|ceph|glusterfs|overlay|pvfs2)
+		# Network filesystems don't know about (or tell the client
+		# about) the underlying file allocation unit and they generally
+		# pass the file IO request to the underlying filesystem, so we
+		# don't have anything to check here.
+		return
+		;;
+	esac
+
+	test $alloc_unit -gt $oplen && \
+		_notrun "$1: file alloc unit $alloc_unit larger than op length $oplen"
+	test $((oplen % alloc_unit)) -eq 0 || \
+		_notrun "$1: file alloc unit $alloc_unit not congruent with op length $oplen"
+}
+
 # Get the minimum block size of an fs.
 _get_block_size()
 {
diff --git a/tests/generic/031 b/tests/generic/031
index cbb2fc34..0d2e8268 100755
--- a/tests/generic/031
+++ b/tests/generic/031
@@ -25,6 +25,7 @@ testfile=$SCRATCH_MNT/testfile
 
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount
+_require_congruent_file_oplen $SCRATCH_MNT 4096
 
 $XFS_IO_PROG -f \
 	-c "pwrite 185332 55756" \
diff --git a/tests/generic/116 b/tests/generic/116
index b8816e31..88b64f4c 100755
--- a/tests/generic/116
+++ b/tests/generic/116
@@ -31,6 +31,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full
 _test_cycle_mount
diff --git a/tests/generic/118 b/tests/generic/118
index 4fa2e1e3..35d933ff 100755
--- a/tests/generic/118
+++ b/tests/generic/118
@@ -32,6 +32,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x62 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full
 _test_cycle_mount
diff --git a/tests/generic/119 b/tests/generic/119
index fd4c3661..481d12d2 100755
--- a/tests/generic/119
+++ b/tests/generic/119
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $((blksz * 8)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x62 0 $((blksz * 8)) $testdir/file2 >> $seqres.full
 _pwrite_byte 0x63 0 $((blksz * 8)) $testdir/file3 >> $seqres.full
diff --git a/tests/generic/121 b/tests/generic/121
index 43137469..e9038240 100755
--- a/tests/generic/121
+++ b/tests/generic/121
@@ -31,6 +31,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full
 _test_cycle_mount
diff --git a/tests/generic/122 b/tests/generic/122
index fbf3f1f2..89309c22 100755
--- a/tests/generic/122
+++ b/tests/generic/122
@@ -31,6 +31,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x62 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full
 _test_cycle_mount
diff --git a/tests/generic/134 b/tests/generic/134
index ab76f046..58b81872 100755
--- a/tests/generic/134
+++ b/tests/generic/134
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file2 >> $seqres.full
 _pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file3 >> $seqres.full
diff --git a/tests/generic/136 b/tests/generic/136
index 98ebb0da..c5b80074 100755
--- a/tests/generic/136
+++ b/tests/generic/136
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file2 >> $seqres.full
 _pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file3 >> $seqres.full
diff --git a/tests/generic/137 b/tests/generic/137
index fb0071b1..8ee705fd 100755
--- a/tests/generic/137
+++ b/tests/generic/137
@@ -37,6 +37,7 @@ mkdir $testdir
 
 echo "Create the original file blocks"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
 _pwrite_byte 0x62 $blksz $((blksz * 2)) $testdir/file1 >> $seqres.full
 
diff --git a/tests/generic/144 b/tests/generic/144
index 842d51f3..21c49577 100755
--- a/tests/generic/144
+++ b/tests/generic/144
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $((blksz * 5 + 37)) $testdir/file1 >> $seqres.full
 
 _reflink_range $testdir/file1 $blksz $testdir/file2 $blksz \
diff --git a/tests/generic/149 b/tests/generic/149
index 5343a139..108f1368 100755
--- a/tests/generic/149
+++ b/tests/generic/149
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
 _pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full
 _pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full
diff --git a/tests/generic/162 b/tests/generic/162
index 0dc17f75..7b625e86 100755
--- a/tests/generic/162
+++ b/tests/generic/162
@@ -38,6 +38,7 @@ mkdir $testdir
 loops=512
 nr_loops=$((loops - 1))
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize files"
 echo >> $seqres.full
diff --git a/tests/generic/163 b/tests/generic/163
index 4a6c341e..91da69d3 100755
--- a/tests/generic/163
+++ b/tests/generic/163
@@ -38,6 +38,7 @@ mkdir $testdir
 loops=512
 nr_loops=$((loops - 1))
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize files"
 echo >> $seqres.full
diff --git a/tests/generic/164 b/tests/generic/164
index 8e0b630b..56c05e37 100755
--- a/tests/generic/164
+++ b/tests/generic/164
@@ -40,6 +40,7 @@ mkdir $testdir
 loops=512
 nr_loops=$((loops - 1))
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize files"
 echo >> $seqres.full
diff --git a/tests/generic/165 b/tests/generic/165
index d9e6a6e9..bc24bcab 100755
--- a/tests/generic/165
+++ b/tests/generic/165
@@ -41,6 +41,7 @@ mkdir $testdir
 loops=512
 nr_loops=$((loops - 1))
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize files"
 echo >> $seqres.full
diff --git a/tests/generic/168 b/tests/generic/168
index 575ff08c..bdc8f7a0 100755
--- a/tests/generic/168
+++ b/tests/generic/168
@@ -39,6 +39,7 @@ mkdir $testdir
 loops=1024
 nr_loops=$((loops - 1))
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize files"
 echo >> $seqres.full
diff --git a/tests/generic/170 b/tests/generic/170
index d323ab8f..593cfbb7 100755
--- a/tests/generic/170
+++ b/tests/generic/170
@@ -40,6 +40,7 @@ mkdir $testdir
 loops=1024
 nr_loops=$((loops - 1))
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize files"
 echo >> $seqres.full
diff --git a/tests/generic/181 b/tests/generic/181
index 2b4617be..5e5883df 100755
--- a/tests/generic/181
+++ b/tests/generic/181
@@ -33,6 +33,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file2 >> $seqres.full
 _pwrite_byte 0x62 0 $((blksz * 2)) $testdir/file2.chk >> $seqres.full
diff --git a/tests/generic/183 b/tests/generic/183
index 77bfcfcb..c8614514 100755
--- a/tests/generic/183
+++ b/tests/generic/183
@@ -39,6 +39,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
diff --git a/tests/generic/185 b/tests/generic/185
index 09469924..75dbc6b8 100755
--- a/tests/generic/185
+++ b/tests/generic/185
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
diff --git a/tests/generic/186 b/tests/generic/186
index 37d88440..c5a1e13a 100755
--- a/tests/generic/186
+++ b/tests/generic/186
@@ -81,6 +81,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=1024
 filesize=$((blksz * nr))
 _pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
diff --git a/tests/generic/187 b/tests/generic/187
index 152e3cc2..be7a635a 100755
--- a/tests/generic/187
+++ b/tests/generic/187
@@ -82,6 +82,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=1024
 filesize=$((blksz * nr))
 _pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
diff --git a/tests/generic/188 b/tests/generic/188
index eab77b39..52a7f2d2 100755
--- a/tests/generic/188
+++ b/tests/generic/188
@@ -39,6 +39,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/189 b/tests/generic/189
index 75cca42a..63faac6e 100755
--- a/tests/generic/189
+++ b/tests/generic/189
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/190 b/tests/generic/190
index 9e220740..b336f12b 100755
--- a/tests/generic/190
+++ b/tests/generic/190
@@ -39,6 +39,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/191 b/tests/generic/191
index 78b9a3f0..1b12d9ac 100755
--- a/tests/generic/191
+++ b/tests/generic/191
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/194 b/tests/generic/194
index ff76438d..aa80560b 100755
--- a/tests/generic/194
+++ b/tests/generic/194
@@ -41,6 +41,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/195 b/tests/generic/195
index e087b99c..4f21201e 100755
--- a/tests/generic/195
+++ b/tests/generic/195
@@ -40,6 +40,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/196 b/tests/generic/196
index e2ae0410..366d0cad 100755
--- a/tests/generic/196
+++ b/tests/generic/196
@@ -39,6 +39,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/197 b/tests/generic/197
index c5f80207..ac314186 100755
--- a/tests/generic/197
+++ b/tests/generic/197
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/199 b/tests/generic/199
index 2a8cafcc..2246fdd1 100755
--- a/tests/generic/199
+++ b/tests/generic/199
@@ -46,6 +46,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/200 b/tests/generic/200
index a1a78ef4..eeefeb50 100755
--- a/tests/generic/200
+++ b/tests/generic/200
@@ -46,6 +46,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/201 b/tests/generic/201
index 2598b44a..0a5a1d4a 100755
--- a/tests/generic/201
+++ b/tests/generic/201
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
diff --git a/tests/generic/284 b/tests/generic/284
index 729da77a..f9eefff3 100755
--- a/tests/generic/284
+++ b/tests/generic/284
@@ -32,6 +32,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/287 b/tests/generic/287
index 76ea26ba..61301368 100755
--- a/tests/generic/287
+++ b/tests/generic/287
@@ -33,6 +33,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/289 b/tests/generic/289
index ed4f3268..52d03c35 100755
--- a/tests/generic/289
+++ b/tests/generic/289
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/290 b/tests/generic/290
index 534fb24f..5352b9ba 100755
--- a/tests/generic/290
+++ b/tests/generic/290
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/291 b/tests/generic/291
index 50119c03..1c589cf6 100755
--- a/tests/generic/291
+++ b/tests/generic/291
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/292 b/tests/generic/292
index 24cdab53..725fe057 100755
--- a/tests/generic/292
+++ b/tests/generic/292
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/293 b/tests/generic/293
index 0f1d8416..05997501 100755
--- a/tests/generic/293
+++ b/tests/generic/293
@@ -36,6 +36,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/295 b/tests/generic/295
index f66c1805..9ccf823f 100755
--- a/tests/generic/295
+++ b/tests/generic/295
@@ -37,6 +37,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _sweave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
diff --git a/tests/generic/352 b/tests/generic/352
index 3f504a29..608c6c81 100755
--- a/tests/generic/352
+++ b/tests/generic/352
@@ -29,6 +29,7 @@ _scratch_mkfs > /dev/null 2>&1
 _scratch_mount
 
 blocksize=$((128 * 1024))
+_require_congruent_file_oplen $SCRATCH_MNT $blocksize
 file="$SCRATCH_MNT/tmp"
 
 # Golden output is for $LOAD_FACTOR == 1 case
diff --git a/tests/generic/358 b/tests/generic/358
index 8c73ba36..91fe5e2b 100755
--- a/tests/generic/358
+++ b/tests/generic/358
@@ -39,6 +39,7 @@ mkdir $testdir
 
 blocks=64
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Initialize file"
 _pwrite_byte 0x61 0 $((blocks * blksz)) $testdir/file >> $seqres.full
diff --git a/tests/generic/359 b/tests/generic/359
index 25692058..8ef4f846 100755
--- a/tests/generic/359
+++ b/tests/generic/359
@@ -41,6 +41,7 @@ mkdir $testdir
 
 blocks=64
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=4
 halfway=$((blocks / 2 * blksz))
 quarter=$((blocks / 4 * blksz))
diff --git a/tests/generic/372 b/tests/generic/372
index b83aa598..b649f590 100755
--- a/tests/generic/372
+++ b/tests/generic/372
@@ -39,6 +39,7 @@ mkdir $testdir
 
 blocks=5
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 sz=$((blocks * blksz))
 
 echo "Create the original files"
diff --git a/tests/generic/414 b/tests/generic/414
index 01b9da8e..6416216d 100755
--- a/tests/generic/414
+++ b/tests/generic/414
@@ -39,6 +39,7 @@ mkdir $testdir
 
 blocks=32
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 sz=$((blocks * blksz))
 
 echo "Create the original files"
diff --git a/tests/generic/501 b/tests/generic/501
index 8c3f627b..cb158ba5 100755
--- a/tests/generic/501
+++ b/tests/generic/501
@@ -34,6 +34,7 @@ _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
 _init_flakey
 _mount_flakey
+_require_congruent_file_oplen $SCRATCH_MNT 2097152
 
 # Use file sizes and offsets/lengths for the clone operation that are multiples
 # of 64Kb, so that the test works on machine with any page size.
diff --git a/tests/generic/515 b/tests/generic/515
index 2f3bd400..758bd639 100755
--- a/tests/generic/515
+++ b/tests/generic/515
@@ -30,6 +30,7 @@ _scratch_mount
 DONOR1=$SCRATCH_MNT/a
 TARGET=$SCRATCH_MNT/b
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 $XFS_IO_PROG -f -c "pwrite -S 0x72 0 $blksz" $DONOR1 >> $seqres.full
 
diff --git a/tests/generic/516 b/tests/generic/516
index 790ad532..e846ee24 100755
--- a/tests/generic/516
+++ b/tests/generic/516
@@ -31,6 +31,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
 _pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file2 >> $seqres.full
 _pwrite_byte 0x62 $(((blksz * 6) - 33)) 1 $testdir/file2 >> $seqres.full
diff --git a/tests/generic/540 b/tests/generic/540
index 38e00f97..da36939a 100755
--- a/tests/generic/540
+++ b/tests/generic/540
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full
diff --git a/tests/generic/541 b/tests/generic/541
index 89b2adad..a0f6cae3 100755
--- a/tests/generic/541
+++ b/tests/generic/541
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full
diff --git a/tests/generic/542 b/tests/generic/542
index e7682f59..530fb8e0 100755
--- a/tests/generic/542
+++ b/tests/generic/542
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full
diff --git a/tests/generic/543 b/tests/generic/543
index 624cfc41..1dad37fb 100755
--- a/tests/generic/543
+++ b/tests/generic/543
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 _pwrite_byte 0x64 0 $((blksz * nr)) $testdir/file2 >> $seqres.full
diff --git a/tests/generic/544 b/tests/generic/544
index 4dbaea4d..a4f654af 100755
--- a/tests/generic/544
+++ b/tests/generic/544
@@ -27,6 +27,7 @@ _scratch_mkfs > $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=2
 filesize=$((blksz * nr))
 testdir=$SCRATCH_MNT/test-$seq
diff --git a/tests/generic/546 b/tests/generic/546
index 7723b980..9dc507be 100755
--- a/tests/generic/546
+++ b/tests/generic/546
@@ -39,6 +39,7 @@ _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
 _init_flakey
 _mount_flakey
+_require_congruent_file_oplen $SCRATCH_MNT 4096
 
 # Create preallocated extent where we can write into
 $XFS_IO_PROG -f -c 'falloc 8k 64m' "$SCRATCH_MNT/foobar" >> $seqres.full
diff --git a/tests/generic/578 b/tests/generic/578
index 01929a28..d04cacb4 100755
--- a/tests/generic/578
+++ b/tests/generic/578
@@ -41,6 +41,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $TEST_DIR $blksz
 filesz=$((blksz * 4))
 _pwrite_byte 0x61 0 $filesz $testdir/file1 >> $seqres.full
 _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
diff --git a/tests/generic/588 b/tests/generic/588
index 563ff65e..a915a73e 100755
--- a/tests/generic/588
+++ b/tests/generic/588
@@ -35,6 +35,8 @@ _require_metadata_journaling $SCRATCH_DEV
 _init_flakey
 _mount_flakey
 
+_require_congruent_file_oplen $SCRATCH_MNT 65536
+
 # Create our test file with two 256Kb extents, one at file offset 0 and the
 # other at file offset 256Kb.
 $XFS_IO_PROG -f -c "pwrite -S 0xa3 0 256K" \
diff --git a/tests/generic/673 b/tests/generic/673
index e40e672a..4d8dc07e 100755
--- a/tests/generic/673
+++ b/tests/generic/673
@@ -22,6 +22,7 @@ _require_scratch_reflink
 
 _scratch_mkfs >> $seqres.full
 _scratch_mount
+_require_congruent_file_oplen $SCRATCH_MNT 1048576
 chmod a+rw $SCRATCH_MNT/
 
 setup_testfile() {
diff --git a/tests/generic/674 b/tests/generic/674
index 920ed5f2..a3130249 100755
--- a/tests/generic/674
+++ b/tests/generic/674
@@ -23,6 +23,7 @@ _require_xfs_io_command dedupe
 
 _scratch_mkfs >> $seqres.full
 _scratch_mount
+_require_congruent_file_oplen $SCRATCH_MNT 1048576
 chmod a+rw $SCRATCH_MNT/
 
 setup_testfile() {
diff --git a/tests/generic/675 b/tests/generic/675
index 23b7e545..189251f2 100755
--- a/tests/generic/675
+++ b/tests/generic/675
@@ -24,6 +24,7 @@ _require_scratch_reflink
 
 _scratch_mkfs >> $seqres.full
 _scratch_mount
+_require_congruent_file_oplen $SCRATCH_MNT 1048576
 chmod a+rw $SCRATCH_MNT/
 
 setup_testfile() {
diff --git a/tests/generic/683 b/tests/generic/683
index 746ead86..4c93346d 100755
--- a/tests/generic/683
+++ b/tests/generic/683
@@ -28,6 +28,7 @@ _require_user
 _require_test
 verb=falloc
 _require_xfs_io_command $verb
+_require_congruent_file_oplen $TEST_DIR 65536
 
 junk_dir=$TEST_DIR/$seq
 junk_file=$junk_dir/a
diff --git a/tests/generic/684 b/tests/generic/684
index 4bebeff0..03481e69 100755
--- a/tests/generic/684
+++ b/tests/generic/684
@@ -28,6 +28,7 @@ _require_user
 _require_test
 verb=fpunch
 _require_xfs_io_command $verb
+_require_congruent_file_oplen $TEST_DIR 65536
 
 junk_dir=$TEST_DIR/$seq
 junk_file=$junk_dir/a
diff --git a/tests/generic/685 b/tests/generic/685
index 03447e00..6a108842 100755
--- a/tests/generic/685
+++ b/tests/generic/685
@@ -28,6 +28,7 @@ _require_user
 _require_test
 verb=fzero
 _require_xfs_io_command $verb
+_require_congruent_file_oplen $TEST_DIR 65536
 
 junk_dir=$TEST_DIR/$seq
 junk_file=$junk_dir/a
diff --git a/tests/generic/686 b/tests/generic/686
index eae3cbda..4279f76b 100755
--- a/tests/generic/686
+++ b/tests/generic/686
@@ -28,6 +28,7 @@ _require_user
 _require_test
 verb=finsert
 _require_xfs_io_command $verb
+_require_congruent_file_oplen $TEST_DIR 65536
 
 junk_dir=$TEST_DIR/$seq
 junk_file=$junk_dir/a
diff --git a/tests/generic/687 b/tests/generic/687
index 0bd421e5..78cb6202 100755
--- a/tests/generic/687
+++ b/tests/generic/687
@@ -28,6 +28,7 @@ _require_user
 _require_test
 verb=fcollapse
 _require_xfs_io_command $verb
+_require_congruent_file_oplen $TEST_DIR 65536
 
 junk_dir=$TEST_DIR/$seq
 junk_file=$junk_dir/a
diff --git a/tests/generic/688 b/tests/generic/688
index 905c46ac..426286b6 100755
--- a/tests/generic/688
+++ b/tests/generic/688
@@ -28,6 +28,7 @@ _require_command "$GETCAP_PROG" getcap
 _require_command "$SETCAP_PROG" setcap
 _require_xfs_io_command falloc
 _require_test
+_require_congruent_file_oplen $TEST_DIR 65536
 
 junk_dir=$TEST_DIR/$seq
 junk_file=$junk_dir/a
diff --git a/tests/xfs/114 b/tests/xfs/114
index a0ea1d13..3aec814a 100755
--- a/tests/xfs/114
+++ b/tests/xfs/114
@@ -35,6 +35,8 @@ len1=$((blocks1 * blksz))
 len2=$((blocks2 * blksz))
 file_blksz=$(_get_file_block_size $SCRATCH_MNT)
 
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
+
 echo "Create some files"
 $XFS_IO_PROG -f \
 	-c "falloc 0 $len1" \
diff --git a/tests/xfs/208 b/tests/xfs/208
index 66c3eda1..0fbb99c8 100755
--- a/tests/xfs/208
+++ b/tests/xfs/208
@@ -35,6 +35,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/210 b/tests/xfs/210
index 6edc5606..2439967b 100755
--- a/tests/xfs/210
+++ b/tests/xfs/210
@@ -27,6 +27,7 @@ _require_xfs_io_command "cowextsize"
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
+_require_congruent_file_oplen $SCRATCH_MNT 65536
 
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
diff --git a/tests/xfs/212 b/tests/xfs/212
index b133e09b..805a72af 100755
--- a/tests/xfs/212
+++ b/tests/xfs/212
@@ -30,6 +30,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=16
 filesize=$((blksz * nr))
 bufnr=2
diff --git a/tests/xfs/215 b/tests/xfs/215
index 20217187..c07cdd1a 100755
--- a/tests/xfs/215
+++ b/tests/xfs/215
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/218 b/tests/xfs/218
index b834bbeb..cc3e1552 100755
--- a/tests/xfs/218
+++ b/tests/xfs/218
@@ -33,6 +33,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/219 b/tests/xfs/219
index b0eeb784..bd2c47bf 100755
--- a/tests/xfs/219
+++ b/tests/xfs/219
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/221 b/tests/xfs/221
index 09b2067d..cda99b5c 100755
--- a/tests/xfs/221
+++ b/tests/xfs/221
@@ -33,6 +33,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/223 b/tests/xfs/223
index 11dbad14..e22c1ba9 100755
--- a/tests/xfs/223
+++ b/tests/xfs/223
@@ -36,6 +36,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/224 b/tests/xfs/224
index f8bab07e..7e984a8a 100755
--- a/tests/xfs/224
+++ b/tests/xfs/224
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/225 b/tests/xfs/225
index 52a37d64..a07ef3f0 100755
--- a/tests/xfs/225
+++ b/tests/xfs/225
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/226 b/tests/xfs/226
index 826bd08d..1e566e2e 100755
--- a/tests/xfs/226
+++ b/tests/xfs/226
@@ -33,6 +33,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/228 b/tests/xfs/228
index f2f2f6a9..85a4abc5 100755
--- a/tests/xfs/228
+++ b/tests/xfs/228
@@ -41,6 +41,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/230 b/tests/xfs/230
index 15f6b684..2347a307 100755
--- a/tests/xfs/230
+++ b/tests/xfs/230
@@ -41,6 +41,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 real_blksz=$(_get_block_size $testdir)
diff --git a/tests/xfs/248 b/tests/xfs/248
index 32902cb7..cdb1da02 100755
--- a/tests/xfs/248
+++ b/tests/xfs/248
@@ -34,6 +34,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/249 b/tests/xfs/249
index 774d3bf2..0c4b0335 100755
--- a/tests/xfs/249
+++ b/tests/xfs/249
@@ -35,6 +35,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/251 b/tests/xfs/251
index 0b090180..1efa331d 100755
--- a/tests/xfs/251
+++ b/tests/xfs/251
@@ -36,6 +36,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/254 b/tests/xfs/254
index 40d176fc..d08ccc52 100755
--- a/tests/xfs/254
+++ b/tests/xfs/254
@@ -37,6 +37,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/255 b/tests/xfs/255
index 255f3b2f..8ec6f0be 100755
--- a/tests/xfs/255
+++ b/tests/xfs/255
@@ -36,6 +36,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/256 b/tests/xfs/256
index 1c703242..7157d532 100755
--- a/tests/xfs/256
+++ b/tests/xfs/256
@@ -37,6 +37,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/257 b/tests/xfs/257
index 6a58f0ac..c3100d60 100755
--- a/tests/xfs/257
+++ b/tests/xfs/257
@@ -38,6 +38,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/258 b/tests/xfs/258
index 2865cdf9..a3a130ea 100755
--- a/tests/xfs/258
+++ b/tests/xfs/258
@@ -39,6 +39,7 @@ mkdir $testdir
 
 echo "Create the original files"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 $XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
diff --git a/tests/xfs/280 b/tests/xfs/280
index bc26e629..0d9a7958 100755
--- a/tests/xfs/280
+++ b/tests/xfs/280
@@ -30,6 +30,7 @@ mkdir $testdir
 
 blocks=5
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 sz=$((blocks * blksz))
 
 echo "Create the original files"
diff --git a/tests/xfs/312 b/tests/xfs/312
index 94f868fe..e4884787 100755
--- a/tests/xfs/312
+++ b/tests/xfs/312
@@ -36,6 +36,7 @@ sz=$((blksz * blks))
 echo "Format filesystem"
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount >> $seqres.full
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Create files"
 _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
diff --git a/tests/xfs/315 b/tests/xfs/315
index 105515ab..9f6b39c8 100755
--- a/tests/xfs/315
+++ b/tests/xfs/315
@@ -37,6 +37,7 @@ sz=$((blksz * blks))
 echo "Format filesystem"
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount >> $seqres.full
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 $XFS_IO_PROG -c "cowextsize $sz" $SCRATCH_MNT
 
diff --git a/tests/xfs/322 b/tests/xfs/322
index 89a2f741..a2c3720e 100755
--- a/tests/xfs/322
+++ b/tests/xfs/322
@@ -36,6 +36,7 @@ sz=$((blksz * blks))
 echo "Format filesystem"
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount >> $seqres.full
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Create files"
 _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
diff --git a/tests/xfs/329 b/tests/xfs/329
index e9a30d05..4cad686c 100755
--- a/tests/xfs/329
+++ b/tests/xfs/329
@@ -31,6 +31,7 @@ _scratch_mount >> "$seqres.full" 2>&1
 
 testdir="$SCRATCH_MNT/test-$seq"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 blks=3
 mkdir "$testdir"
 
diff --git a/tests/xfs/436 b/tests/xfs/436
index d99183cf..9e6ec937 100755
--- a/tests/xfs/436
+++ b/tests/xfs/436
@@ -42,6 +42,7 @@ _scratch_mount -o noquota >> "$seqres.full" 2>&1
 
 testdir="$SCRATCH_MNT/test-$seq"
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 blks=3
 mkdir "$testdir"
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/8] misc: skip extent size hint tests when hint not congruent with file allocation unit
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 1/8] misc: use _get_file_block_size for block (re)mapping tests Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 2/8] misc: skip remap/fallocate tests when op length not congruent with file allocation unit Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 4/8] misc: avoid tests encoding FIEMAP/BMAP golden output with weird file blocksizes Darrick J. Wong
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

From: Darrick J. Wong <djwong@kernel.org>

XFS files have an extent size hint, which tells the block allocator that
it should try to allocate larger aligned blocks when possible.  These
hints must be some integer multiple of the allocation unit size, which
is one fs block for files on the data device, and one rt extent for
files on the realtime device.  For tests that are hardwired to a static
extent size hint, the fssetxattr call will fail if the hint isn't
congruent, so just skip those tests.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/069 |    1 +
 tests/xfs/180 |    1 +
 tests/xfs/182 |    1 +
 tests/xfs/184 |    1 +
 tests/xfs/192 |    1 +
 tests/xfs/193 |    1 +
 tests/xfs/198 |    1 +
 tests/xfs/200 |    1 +
 tests/xfs/204 |    1 +
 tests/xfs/209 |    1 +
 tests/xfs/211 |    1 +
 tests/xfs/231 |    1 +
 tests/xfs/232 |    1 +
 tests/xfs/237 |    1 +
 tests/xfs/239 |    1 +
 tests/xfs/240 |    1 +
 tests/xfs/241 |    1 +
 tests/xfs/326 |    1 +
 tests/xfs/346 |    1 +
 tests/xfs/347 |    1 +
 tests/xfs/507 |    3 +++
 21 files changed, 23 insertions(+)


diff --git a/tests/xfs/069 b/tests/xfs/069
index bf4aa202..b3074e25 100755
--- a/tests/xfs/069
+++ b/tests/xfs/069
@@ -22,6 +22,7 @@ _require_scratch
 
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
+_require_congruent_file_oplen $SCRATCH_MNT 8388608
 
 small=$SCRATCH_MNT/small
 big=$SCRATCH_MNT/big
diff --git a/tests/xfs/180 b/tests/xfs/180
index 72a1b738..9b52f1ff 100755
--- a/tests/xfs/180
+++ b/tests/xfs/180
@@ -32,6 +32,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/182 b/tests/xfs/182
index ea565824..93852229 100755
--- a/tests/xfs/182
+++ b/tests/xfs/182
@@ -33,6 +33,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/184 b/tests/xfs/184
index 95250b29..2ca6528e 100755
--- a/tests/xfs/184
+++ b/tests/xfs/184
@@ -33,6 +33,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/192 b/tests/xfs/192
index 1eb9d52e..8329604d 100755
--- a/tests/xfs/192
+++ b/tests/xfs/192
@@ -34,6 +34,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/193 b/tests/xfs/193
index 1bc48610..18f2fc2f 100755
--- a/tests/xfs/193
+++ b/tests/xfs/193
@@ -31,6 +31,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/198 b/tests/xfs/198
index 0c650874..231e1c23 100755
--- a/tests/xfs/198
+++ b/tests/xfs/198
@@ -32,6 +32,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/200 b/tests/xfs/200
index 2324fbdb..435cd9b9 100755
--- a/tests/xfs/200
+++ b/tests/xfs/200
@@ -35,6 +35,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/204 b/tests/xfs/204
index 931be128..3f9b6dca 100755
--- a/tests/xfs/204
+++ b/tests/xfs/204
@@ -36,6 +36,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/209 b/tests/xfs/209
index 220ea31d..08ec87f5 100755
--- a/tests/xfs/209
+++ b/tests/xfs/209
@@ -23,6 +23,7 @@ _require_xfs_io_command "cowextsize"
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
+_require_congruent_file_oplen $SCRATCH_MNT 1048576
 
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
diff --git a/tests/xfs/211 b/tests/xfs/211
index 05515041..b99871ba 100755
--- a/tests/xfs/211
+++ b/tests/xfs/211
@@ -33,6 +33,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=50000
 filesize=$((blksz * nr))
 bufnr=16
diff --git a/tests/xfs/231 b/tests/xfs/231
index 8155d0ab..fd7d7a85 100755
--- a/tests/xfs/231
+++ b/tests/xfs/231
@@ -45,6 +45,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 bufnr=2
diff --git a/tests/xfs/232 b/tests/xfs/232
index 06217466..0bf3bb75 100755
--- a/tests/xfs/232
+++ b/tests/xfs/232
@@ -46,6 +46,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=64
 filesize=$((blksz * nr))
 bufnr=2
diff --git a/tests/xfs/237 b/tests/xfs/237
index 34d54a6c..db235e05 100755
--- a/tests/xfs/237
+++ b/tests/xfs/237
@@ -46,6 +46,7 @@ bufsize=$((blksz * bufnr))
 alignment=`_min_dio_alignment $TEST_DEV`
 
 _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 
 echo "Create the original files"
 $XFS_IO_PROG -c "cowextsize $((bufsize * 2))" $testdir
diff --git a/tests/xfs/239 b/tests/xfs/239
index 5143cc2e..f04460bc 100755
--- a/tests/xfs/239
+++ b/tests/xfs/239
@@ -35,6 +35,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=640
 bufnr=128
 filesize=$((blksz * nr))
diff --git a/tests/xfs/240 b/tests/xfs/240
index e5d35a83..a65c270d 100755
--- a/tests/xfs/240
+++ b/tests/xfs/240
@@ -40,6 +40,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=640
 bufnr=128
 filesize=$((blksz * nr))
diff --git a/tests/xfs/241 b/tests/xfs/241
index 7988c2d8..d9879788 100755
--- a/tests/xfs/241
+++ b/tests/xfs/241
@@ -36,6 +36,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=640
 bufnr=128
 filesize=$((blksz * nr))
diff --git a/tests/xfs/326 b/tests/xfs/326
index 8b95a18a..d8a9ac25 100755
--- a/tests/xfs/326
+++ b/tests/xfs/326
@@ -40,6 +40,7 @@ echo "Format filesystem"
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount >> $seqres.full
 
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 $XFS_IO_PROG -c "cowextsize $sz" $SCRATCH_MNT
 
 echo "Create files"
diff --git a/tests/xfs/346 b/tests/xfs/346
index bb542202..6d371342 100755
--- a/tests/xfs/346
+++ b/tests/xfs/346
@@ -34,6 +34,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=8
diff --git a/tests/xfs/347 b/tests/xfs/347
index 63ee1ec6..86f405b5 100755
--- a/tests/xfs/347
+++ b/tests/xfs/347
@@ -33,6 +33,7 @@ testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
 blksz=65536
+_require_congruent_file_oplen $SCRATCH_MNT $blksz
 nr=128
 filesize=$((blksz * nr))
 bufnr=8
diff --git a/tests/xfs/507 b/tests/xfs/507
index b9c9ab29..8757152e 100755
--- a/tests/xfs/507
+++ b/tests/xfs/507
@@ -44,6 +44,9 @@ echo "Format and mount"
 _scratch_mkfs > "$seqres.full" 2>&1
 _scratch_mount
 
+fs_blksz=$(_get_block_size $SCRATCH_MNT)
+_require_congruent_file_oplen $SCRATCH_MNT $((MAXEXTLEN * fs_blksz))
+
 # Create a huge sparse filesystem on the scratch device because that's what
 # we're going to need to guarantee that we have enough blocks to overflow in
 # the first place.  We need to have at least enough free space on that huge fs


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/8] misc: avoid tests encoding FIEMAP/BMAP golden output with weird file blocksizes
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
                   ` (2 preceding siblings ...)
  2022-07-19 21:37 ` [PATCH 3/8] misc: skip extent size hint tests when hint " Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 5/8] punch: use allocation unit to test punching holes Darrick J. Wong
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

From: Darrick J. Wong <djwong@kernel.org>

Some tests encode FIEMAP/XFS_IOC_BMAP results in the golden output.
Typically these tests cannot handle a filesystem that chooses to
allocate extents that are much larger than the filesystem block size
(aka XFS rt extents and ext4 bigalloc).  Since these tests are /never/
going to pass, disable them when these configurations are detected.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/483 |    4 ++++
 tests/generic/677 |    4 ++++
 tests/xfs/166     |    4 ++++
 tests/xfs/203     |    4 ++++
 4 files changed, 16 insertions(+)


diff --git a/tests/generic/483 b/tests/generic/483
index e7120362..39129542 100755
--- a/tests/generic/483
+++ b/tests/generic/483
@@ -35,6 +35,10 @@ _require_metadata_journaling $SCRATCH_DEV
 _init_flakey
 _mount_flakey
 
+# The fiemap results in the golden output requires file allocations to align to
+# 256K boundaries.
+_require_congruent_file_oplen $SCRATCH_MNT 262144
+
 # Create our test files.
 $XFS_IO_PROG -f -c "pwrite -S 0xea 0 256K" $SCRATCH_MNT/foo >/dev/null
 
diff --git a/tests/generic/677 b/tests/generic/677
index 39af90a9..4dbfed7d 100755
--- a/tests/generic/677
+++ b/tests/generic/677
@@ -38,6 +38,10 @@ _require_metadata_journaling $SCRATCH_DEV
 _init_flakey
 _mount_flakey
 
+# The fiemap results in the golden output requires file allocations to align to
+# 1MB boundaries.
+_require_congruent_file_oplen $SCRATCH_MNT 1048576
+
 # Create our test file with many extents.
 # On btrfs this results in having multiple leaves of metadata full of file
 # extent items, a condition necessary to trigger the original bug.
diff --git a/tests/xfs/166 b/tests/xfs/166
index d45dc5e8..9e082152 100755
--- a/tests/xfs/166
+++ b/tests/xfs/166
@@ -71,6 +71,10 @@ TEST_PROG=$here/src/unwritten_mmap
 # we need to set the file size to (6 * 2MB == 12MB) to cover all cases.
 FILE_SIZE=$((12 * 1048576))
 
+# The xfs_bmap results in the golden output requires file allocations to align
+# to 1M boundaries.
+_require_congruent_file_oplen $SCRATCH_MNT $FILE_SIZE
+
 rm -f $TEST_FILE
 $TEST_PROG $FILE_SIZE $TEST_FILE
 
diff --git a/tests/xfs/203 b/tests/xfs/203
index a12ae7c3..9a4a4564 100755
--- a/tests/xfs/203
+++ b/tests/xfs/203
@@ -51,6 +51,10 @@ _require_scratch
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount > /dev/null 2>&1
 
+# The xfs_bmap results in the golden output requires file allocations to align
+# to 64k boundaries.
+_require_congruent_file_oplen $SCRATCH_MNT 65536
+
 for i in 10 14 15 16 17 28 29 30 31; do
         rm -f $SCRATCH_MNT/hole_file
 	_write_holes $SCRATCH_MNT/hole_file${i} ${i}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/8] punch: use allocation unit to test punching holes
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
                   ` (3 preceding siblings ...)
  2022-07-19 21:37 ` [PATCH 4/8] misc: avoid tests encoding FIEMAP/BMAP golden output with weird file blocksizes Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 6/8] punch: skip fpunch tests when op length not congruent with file allocation unit Darrick J. Wong
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

From: Darrick J. Wong <djwong@kernel.org>

In step 17 of _test_generic_punch, we want to test that we can write
a file with a single block, use one of unresvsp, fpunch, or fzero to
modify the file, and then check that the file has one written block
followed by a hole.

Unfortunately, the test helper uses _get_block_size to determine how
much data to write to the test file.  For filesystems with an allocation
unit size that is not the fs block size (e.g. XFS realtime with a rt
extent size), this produces unwritten extents in the fiemap output,
which causes test failures.

Fix step 17 to obtain the file allocation unit size with
_get_file_block_size.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/punch      |    2 +-
 tests/generic/153 |    2 +-
 tests/generic/404 |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/common/punch b/common/punch
index b6b8a0b9..4d16b898 100644
--- a/common/punch
+++ b/common/punch
@@ -480,7 +480,7 @@ _test_generic_punch()
 	if [ "$remove_testfile" ]; then
 		rm -f $testfile
 	fi
-	block_size=`_get_block_size $TEST_DIR`
+	block_size=`_get_file_block_size $TEST_DIR`
 	$XFS_IO_PROG -f -c "truncate $block_size" \
 		-c "pwrite 0 $block_size" $sync_cmd \
 		-c "$zero_cmd 128 128" \
diff --git a/tests/generic/153 b/tests/generic/153
index 40877266..342959fd 100755
--- a/tests/generic/153
+++ b/tests/generic/153
@@ -37,7 +37,7 @@ rm -rf $testdir
 mkdir $testdir
 
 echo "Create the original file blocks"
-blksz="$(_get_block_size $testdir)"
+blksz="$(_get_file_block_size $testdir)"
 blks=2000
 margin='15%'
 sz=$((blksz * blks))
diff --git a/tests/generic/404 b/tests/generic/404
index 939692eb..30fce85d 100755
--- a/tests/generic/404
+++ b/tests/generic/404
@@ -69,7 +69,7 @@ _require_test
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "finsert"
 
-blksize=`_get_block_size $TEST_DIR`
+blksize=`_get_file_block_size $TEST_DIR`
 
 # Generate a block with a repeating number represented as 4 bytes decimal.
 # The test generates unique pattern for each block in order to observe a


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/8] punch: skip fpunch tests when op length not congruent with file allocation unit
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
                   ` (4 preceding siblings ...)
  2022-07-19 21:37 ` [PATCH 5/8] punch: use allocation unit to test punching holes Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:37 ` [PATCH 7/8] filter: report data block mappings and od offsets in multiples of allocation units Darrick J. Wong
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

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 --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.


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/8] filter: report data block mappings and od offsets in multiples of allocation units
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
                   ` (5 preceding siblings ...)
  2022-07-19 21:37 ` [PATCH 6/8] punch: skip fpunch tests when op length not congruent with file allocation unit Darrick J. Wong
@ 2022-07-19 21:37 ` Darrick J. Wong
  2022-07-19 21:38 ` [PATCH 8/8] punch: skip fpunch tests when page size not congruent with file allocation unit Darrick J. Wong
  2022-07-24 14:01 ` [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Zorro Lang
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:37 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

From: Darrick J. Wong <djwong@kernel.org>

All the tests that use these two filter functions also make all of their
fallocate calls in units of file allocation units, not filesystem
blocks.  Make them transform the file offsets to multiples of file
allocation units (via _get_file_block_size) so that xfs/242 and xfs/252
will work with XFS with a rt extent size set.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
---
 common/filter |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/common/filter b/common/filter
index 14f6a027..28dea646 100644
--- a/common/filter
+++ b/common/filter
@@ -221,7 +221,7 @@ _filter_xfs_io_units_modified()
 
 _filter_xfs_io_blocks_modified()
 {
-	BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
+	BLOCK_SIZE=$(_get_file_block_size $SCRATCH_MNT)
 
 	_filter_xfs_io_units_modified "Block" $BLOCK_SIZE
 }
@@ -457,7 +457,7 @@ _filter_busy_mount()
 
 _filter_od()
 {
-	BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
+	BLOCK_SIZE=$(_get_file_block_size $SCRATCH_MNT)
 	$AWK_PROG -v block_size=$BLOCK_SIZE '
 		/^[0-9]+/ {
 			offset = strtonum("0"$1);


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/8] punch: skip fpunch tests when page size not congruent with file allocation unit
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
                   ` (6 preceding siblings ...)
  2022-07-19 21:37 ` [PATCH 7/8] filter: report data block mappings and od offsets in multiples of allocation units Darrick J. Wong
@ 2022-07-19 21:38 ` Darrick J. Wong
  2022-07-24 14:01 ` [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Zorro Lang
  8 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-19 21:38 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan, tytso, leah.rumancik

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 system page size.  This is needed for
testing swapfiles and mmap collisions wiht fallocate.

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>
---
 tests/generic/495 |    4 ++++
 tests/generic/503 |    4 ++++
 2 files changed, 8 insertions(+)


diff --git a/tests/generic/495 b/tests/generic/495
index 608f1715..5e03dfee 100755
--- a/tests/generic/495
+++ b/tests/generic/495
@@ -21,6 +21,10 @@ _require_sparse_files
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 
+blksize=$(_get_file_block_size $SCRATCH_MNT)
+test $blksize -eq $(getconf PAGE_SIZE) || \
+	_notrun "swap file allocation unit size must match page size"
+
 # We can't use _format_swapfile because we're using our custom mkswap and
 # swapon.
 touch "$SCRATCH_MNT/swap"
diff --git a/tests/generic/503 b/tests/generic/503
index a6971e63..ff3390bf 100755
--- a/tests/generic/503
+++ b/tests/generic/503
@@ -38,6 +38,10 @@ _scratch_mkfs >> $seqres.full 2>&1
 export MOUNT_OPTIONS=""
 _scratch_mount >> $seqres.full 2>&1
 
+blksize=$(_get_file_block_size $SCRATCH_MNT)
+test $blksize -eq $(getconf PAGE_SIZE) || \
+	_notrun "file block size must match page size"
+
 # real QA test starts here
 $here/src/t_mmap_collision $TEST_DIR/testfile $SCRATCH_MNT/testfile
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCHSET v2 0/8] fstests: check file block congruency of file range operations
  2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
                   ` (7 preceding siblings ...)
  2022-07-19 21:38 ` [PATCH 8/8] punch: skip fpunch tests when page size not congruent with file allocation unit Darrick J. Wong
@ 2022-07-24 14:01 ` Zorro Lang
  2022-07-25 21:02   ` Darrick J. Wong
  8 siblings, 1 reply; 11+ messages in thread
From: Zorro Lang @ 2022-07-24 14:01 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, fstests

On Tue, Jul 19, 2022 at 02:37:16PM -0700, Darrick J. Wong wrote:
> Hi all,
> 
> I started running fstests with XFS filesystems that don't have the usual
> file geometry characteristics -- block sizes larger than 4k, realtime
> filesystems with extent sizes that aren't a power of two, etc.  What I
> found is that many file operation tests (fallocate, reflink, etc.) that
> operate on disk blocks assume that aligning the arguments to 64k is
> sufficient to avoid EINVAL.  Unfortunately, this just means that these
> tests fail left and right on realtime filesystems where the file
> allocation unit is large (~2MB, anyone?) or a weird number (28K).
> 
> Add a predicate to all of these tests so that we can _notrun them if
> they make assumptions about file size /and/ encode something (usually
> file hashes) in the golden output that mean we can't easily accomodate
> these corner cases without redesigning each test.
> 
> v2: skip congruency tests for network filesystems, be more consistent about
>     TEST_DIR in the arguments, fix a bug in a helper's callsite reported by
>     Zorro.
> 
> If you're going to start using this mess, you probably ought to just
> pull from my git trees, which are linked below.
> 
> This is an extraordinary way to destroy everything.  Enjoy!
> Comments and questions are, as always, welcome.
> 
> --D

I'd like to merge this patchset after my personal review and testing. As I
didn't find any regression from this patchset, and there's not any objection
from anyone after two weeks passed. So I'm going to merge it, to help Darrick
shift to his next patchset he's working on.

Reviewed-by: Zorro Lang <zlang@redhat.com>

> 
> fstests git tree:
> https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=check-blocksize-congruency
> ---
>  common/filter     |    4 ++--
>  common/punch      |    3 ++-
>  common/rc         |   28 +++++++++++++++++++++++++++-
>  tests/generic/017 |    2 +-
>  tests/generic/031 |    1 +
>  tests/generic/064 |    2 +-
>  tests/generic/116 |    1 +
>  tests/generic/118 |    1 +
>  tests/generic/119 |    1 +
>  tests/generic/121 |    1 +
>  tests/generic/122 |    1 +
>  tests/generic/134 |    1 +
>  tests/generic/136 |    1 +
>  tests/generic/137 |    1 +
>  tests/generic/144 |    1 +
>  tests/generic/149 |    1 +
>  tests/generic/153 |    2 +-
>  tests/generic/158 |    2 +-
>  tests/generic/162 |    1 +
>  tests/generic/163 |    1 +
>  tests/generic/164 |    1 +
>  tests/generic/165 |    1 +
>  tests/generic/168 |    1 +
>  tests/generic/170 |    1 +
>  tests/generic/181 |    1 +
>  tests/generic/183 |    1 +
>  tests/generic/185 |    1 +
>  tests/generic/186 |    1 +
>  tests/generic/187 |    1 +
>  tests/generic/188 |    1 +
>  tests/generic/189 |    1 +
>  tests/generic/190 |    1 +
>  tests/generic/191 |    1 +
>  tests/generic/194 |    1 +
>  tests/generic/195 |    1 +
>  tests/generic/196 |    1 +
>  tests/generic/197 |    1 +
>  tests/generic/199 |    1 +
>  tests/generic/200 |    1 +
>  tests/generic/201 |    1 +
>  tests/generic/284 |    1 +
>  tests/generic/287 |    1 +
>  tests/generic/289 |    1 +
>  tests/generic/290 |    1 +
>  tests/generic/291 |    1 +
>  tests/generic/292 |    1 +
>  tests/generic/293 |    1 +
>  tests/generic/295 |    1 +
>  tests/generic/352 |    1 +
>  tests/generic/358 |    1 +
>  tests/generic/359 |    1 +
>  tests/generic/372 |    1 +
>  tests/generic/404 |    2 +-
>  tests/generic/414 |    1 +
>  tests/generic/483 |    4 ++++
>  tests/generic/495 |    4 ++++
>  tests/generic/501 |    1 +
>  tests/generic/503 |    4 ++++
>  tests/generic/515 |    1 +
>  tests/generic/516 |    1 +
>  tests/generic/540 |    1 +
>  tests/generic/541 |    1 +
>  tests/generic/542 |    1 +
>  tests/generic/543 |    1 +
>  tests/generic/544 |    1 +
>  tests/generic/546 |    1 +
>  tests/generic/578 |    1 +
>  tests/generic/588 |    2 ++
>  tests/generic/673 |    1 +
>  tests/generic/674 |    1 +
>  tests/generic/675 |    1 +
>  tests/generic/677 |    4 ++++
>  tests/generic/683 |    1 +
>  tests/generic/684 |    1 +
>  tests/generic/685 |    1 +
>  tests/generic/686 |    1 +
>  tests/generic/687 |    1 +
>  tests/generic/688 |    1 +
>  tests/xfs/069     |    1 +
>  tests/xfs/114     |    2 ++
>  tests/xfs/166     |    4 ++++
>  tests/xfs/180     |    1 +
>  tests/xfs/182     |    1 +
>  tests/xfs/184     |    1 +
>  tests/xfs/192     |    1 +
>  tests/xfs/193     |    1 +
>  tests/xfs/198     |    1 +
>  tests/xfs/200     |    1 +
>  tests/xfs/203     |    4 ++++
>  tests/xfs/204     |    1 +
>  tests/xfs/208     |    1 +
>  tests/xfs/209     |    1 +
>  tests/xfs/210     |    1 +
>  tests/xfs/211     |    1 +
>  tests/xfs/212     |    1 +
>  tests/xfs/215     |    1 +
>  tests/xfs/218     |    1 +
>  tests/xfs/219     |    1 +
>  tests/xfs/221     |    1 +
>  tests/xfs/223     |    1 +
>  tests/xfs/224     |    1 +
>  tests/xfs/225     |    1 +
>  tests/xfs/226     |    1 +
>  tests/xfs/228     |    1 +
>  tests/xfs/230     |    1 +
>  tests/xfs/231     |    1 +
>  tests/xfs/232     |    1 +
>  tests/xfs/237     |    1 +
>  tests/xfs/239     |    1 +
>  tests/xfs/240     |    1 +
>  tests/xfs/241     |    1 +
>  tests/xfs/248     |    1 +
>  tests/xfs/249     |    1 +
>  tests/xfs/251     |    1 +
>  tests/xfs/254     |    1 +
>  tests/xfs/255     |    1 +
>  tests/xfs/256     |    1 +
>  tests/xfs/257     |    1 +
>  tests/xfs/258     |    1 +
>  tests/xfs/280     |    1 +
>  tests/xfs/312     |    1 +
>  tests/xfs/315     |    1 +
>  tests/xfs/322     |    1 +
>  tests/xfs/326     |    1 +
>  tests/xfs/329     |    1 +
>  tests/xfs/346     |    1 +
>  tests/xfs/347     |    1 +
>  tests/xfs/436     |    1 +
>  tests/xfs/507     |    3 +++
>  tests/xfs/537     |    2 +-
>  130 files changed, 180 insertions(+), 10 deletions(-)
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCHSET v2 0/8] fstests: check file block congruency of file range operations
  2022-07-24 14:01 ` [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Zorro Lang
@ 2022-07-25 21:02   ` Darrick J. Wong
  0 siblings, 0 replies; 11+ messages in thread
From: Darrick J. Wong @ 2022-07-25 21:02 UTC (permalink / raw)
  To: Zorro Lang; +Cc: linux-xfs, fstests

On Sun, Jul 24, 2022 at 10:01:27PM +0800, Zorro Lang wrote:
> On Tue, Jul 19, 2022 at 02:37:16PM -0700, Darrick J. Wong wrote:
> > Hi all,
> > 
> > I started running fstests with XFS filesystems that don't have the usual
> > file geometry characteristics -- block sizes larger than 4k, realtime
> > filesystems with extent sizes that aren't a power of two, etc.  What I
> > found is that many file operation tests (fallocate, reflink, etc.) that
> > operate on disk blocks assume that aligning the arguments to 64k is
> > sufficient to avoid EINVAL.  Unfortunately, this just means that these
> > tests fail left and right on realtime filesystems where the file
> > allocation unit is large (~2MB, anyone?) or a weird number (28K).
> > 
> > Add a predicate to all of these tests so that we can _notrun them if
> > they make assumptions about file size /and/ encode something (usually
> > file hashes) in the golden output that mean we can't easily accomodate
> > these corner cases without redesigning each test.
> > 
> > v2: skip congruency tests for network filesystems, be more consistent about
> >     TEST_DIR in the arguments, fix a bug in a helper's callsite reported by
> >     Zorro.
> > 
> > If you're going to start using this mess, you probably ought to just
> > pull from my git trees, which are linked below.
> > 
> > This is an extraordinary way to destroy everything.  Enjoy!
> > Comments and questions are, as always, welcome.
> > 
> > --D
> 
> I'd like to merge this patchset after my personal review and testing. As I
> didn't find any regression from this patchset, and there's not any objection
> from anyone after two weeks passed. So I'm going to merge it, to help Darrick
> shift to his next patchset he's working on.

Thanks!

--D

> Reviewed-by: Zorro Lang <zlang@redhat.com>
> 
> > 
> > fstests git tree:
> > https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=check-blocksize-congruency
> > ---
> >  common/filter     |    4 ++--
> >  common/punch      |    3 ++-
> >  common/rc         |   28 +++++++++++++++++++++++++++-
> >  tests/generic/017 |    2 +-
> >  tests/generic/031 |    1 +
> >  tests/generic/064 |    2 +-
> >  tests/generic/116 |    1 +
> >  tests/generic/118 |    1 +
> >  tests/generic/119 |    1 +
> >  tests/generic/121 |    1 +
> >  tests/generic/122 |    1 +
> >  tests/generic/134 |    1 +
> >  tests/generic/136 |    1 +
> >  tests/generic/137 |    1 +
> >  tests/generic/144 |    1 +
> >  tests/generic/149 |    1 +
> >  tests/generic/153 |    2 +-
> >  tests/generic/158 |    2 +-
> >  tests/generic/162 |    1 +
> >  tests/generic/163 |    1 +
> >  tests/generic/164 |    1 +
> >  tests/generic/165 |    1 +
> >  tests/generic/168 |    1 +
> >  tests/generic/170 |    1 +
> >  tests/generic/181 |    1 +
> >  tests/generic/183 |    1 +
> >  tests/generic/185 |    1 +
> >  tests/generic/186 |    1 +
> >  tests/generic/187 |    1 +
> >  tests/generic/188 |    1 +
> >  tests/generic/189 |    1 +
> >  tests/generic/190 |    1 +
> >  tests/generic/191 |    1 +
> >  tests/generic/194 |    1 +
> >  tests/generic/195 |    1 +
> >  tests/generic/196 |    1 +
> >  tests/generic/197 |    1 +
> >  tests/generic/199 |    1 +
> >  tests/generic/200 |    1 +
> >  tests/generic/201 |    1 +
> >  tests/generic/284 |    1 +
> >  tests/generic/287 |    1 +
> >  tests/generic/289 |    1 +
> >  tests/generic/290 |    1 +
> >  tests/generic/291 |    1 +
> >  tests/generic/292 |    1 +
> >  tests/generic/293 |    1 +
> >  tests/generic/295 |    1 +
> >  tests/generic/352 |    1 +
> >  tests/generic/358 |    1 +
> >  tests/generic/359 |    1 +
> >  tests/generic/372 |    1 +
> >  tests/generic/404 |    2 +-
> >  tests/generic/414 |    1 +
> >  tests/generic/483 |    4 ++++
> >  tests/generic/495 |    4 ++++
> >  tests/generic/501 |    1 +
> >  tests/generic/503 |    4 ++++
> >  tests/generic/515 |    1 +
> >  tests/generic/516 |    1 +
> >  tests/generic/540 |    1 +
> >  tests/generic/541 |    1 +
> >  tests/generic/542 |    1 +
> >  tests/generic/543 |    1 +
> >  tests/generic/544 |    1 +
> >  tests/generic/546 |    1 +
> >  tests/generic/578 |    1 +
> >  tests/generic/588 |    2 ++
> >  tests/generic/673 |    1 +
> >  tests/generic/674 |    1 +
> >  tests/generic/675 |    1 +
> >  tests/generic/677 |    4 ++++
> >  tests/generic/683 |    1 +
> >  tests/generic/684 |    1 +
> >  tests/generic/685 |    1 +
> >  tests/generic/686 |    1 +
> >  tests/generic/687 |    1 +
> >  tests/generic/688 |    1 +
> >  tests/xfs/069     |    1 +
> >  tests/xfs/114     |    2 ++
> >  tests/xfs/166     |    4 ++++
> >  tests/xfs/180     |    1 +
> >  tests/xfs/182     |    1 +
> >  tests/xfs/184     |    1 +
> >  tests/xfs/192     |    1 +
> >  tests/xfs/193     |    1 +
> >  tests/xfs/198     |    1 +
> >  tests/xfs/200     |    1 +
> >  tests/xfs/203     |    4 ++++
> >  tests/xfs/204     |    1 +
> >  tests/xfs/208     |    1 +
> >  tests/xfs/209     |    1 +
> >  tests/xfs/210     |    1 +
> >  tests/xfs/211     |    1 +
> >  tests/xfs/212     |    1 +
> >  tests/xfs/215     |    1 +
> >  tests/xfs/218     |    1 +
> >  tests/xfs/219     |    1 +
> >  tests/xfs/221     |    1 +
> >  tests/xfs/223     |    1 +
> >  tests/xfs/224     |    1 +
> >  tests/xfs/225     |    1 +
> >  tests/xfs/226     |    1 +
> >  tests/xfs/228     |    1 +
> >  tests/xfs/230     |    1 +
> >  tests/xfs/231     |    1 +
> >  tests/xfs/232     |    1 +
> >  tests/xfs/237     |    1 +
> >  tests/xfs/239     |    1 +
> >  tests/xfs/240     |    1 +
> >  tests/xfs/241     |    1 +
> >  tests/xfs/248     |    1 +
> >  tests/xfs/249     |    1 +
> >  tests/xfs/251     |    1 +
> >  tests/xfs/254     |    1 +
> >  tests/xfs/255     |    1 +
> >  tests/xfs/256     |    1 +
> >  tests/xfs/257     |    1 +
> >  tests/xfs/258     |    1 +
> >  tests/xfs/280     |    1 +
> >  tests/xfs/312     |    1 +
> >  tests/xfs/315     |    1 +
> >  tests/xfs/322     |    1 +
> >  tests/xfs/326     |    1 +
> >  tests/xfs/329     |    1 +
> >  tests/xfs/346     |    1 +
> >  tests/xfs/347     |    1 +
> >  tests/xfs/436     |    1 +
> >  tests/xfs/507     |    3 +++
> >  tests/xfs/537     |    2 +-
> >  130 files changed, 180 insertions(+), 10 deletions(-)
> > 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-25 21:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 21:37 [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Darrick J. Wong
2022-07-19 21:37 ` [PATCH 1/8] misc: use _get_file_block_size for block (re)mapping tests Darrick J. Wong
2022-07-19 21:37 ` [PATCH 2/8] misc: skip remap/fallocate tests when op length not congruent with file allocation unit Darrick J. Wong
2022-07-19 21:37 ` [PATCH 3/8] misc: skip extent size hint tests when hint " Darrick J. Wong
2022-07-19 21:37 ` [PATCH 4/8] misc: avoid tests encoding FIEMAP/BMAP golden output with weird file blocksizes Darrick J. Wong
2022-07-19 21:37 ` [PATCH 5/8] punch: use allocation unit to test punching holes Darrick J. Wong
2022-07-19 21:37 ` [PATCH 6/8] punch: skip fpunch tests when op length not congruent with file allocation unit Darrick J. Wong
2022-07-19 21:37 ` [PATCH 7/8] filter: report data block mappings and od offsets in multiples of allocation units Darrick J. Wong
2022-07-19 21:38 ` [PATCH 8/8] punch: skip fpunch tests when page size not congruent with file allocation unit Darrick J. Wong
2022-07-24 14:01 ` [PATCHSET v2 0/8] fstests: check file block congruency of file range operations Zorro Lang
2022-07-25 21:02   ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.