diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-05-02 13:08:23 -0700 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2023-05-14 21:50:55 +0800 |
commit | 23e11f53b4b633947b42867c02fd8e943012389a (patch) | |
tree | 6a1f8004a5c53301369f56096580c9b30ea053b0 | |
parent | f093a7503a6a291456879cad6127f0cf4bb5ea0d (diff) | |
download | xfstests-dev-23e11f53b4b633947b42867c02fd8e943012389a.tar.gz |
generic/724,xfs/791: adjust test preconditions for post-EOF stripe zeroing
I recently introduced a new fstests config with explicitly specified
stripe geometry of 128k stripe units and a stripe width of 4. This
broke both of these tests because I hadn't counted on a few things:
1) The write to $SCRATCH_MNT/b at 768k would a 128k delalloc extent
2) This delalloc extent would extend beyond EOF
3) Increasing the file size from 832k to 1m would cause iomap to zero
the pagecache for the parts of the delalloc extent beyond EOF
4) The newly dirtied posteof delalloc areas would get written to disk
with a real space allocation
Under these circumstances, FIEXCHRANGE with SKIP_FILE1_HOLES sees a
written extent containing zeroes in file B between 832k and 1m. File
A has a written extent containing 'X' in the same range, so it exchanges
the two. When RAID geometry is disabled, the area between 832k and 1m
is usually a hole, so FIEXCHRANGE does nothing. This causes the md5sum
of the two files to be different, and the test fails.
Fix the test by truncating B to 1m before writing anything to it.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
-rwxr-xr-x | tests/generic/724 | 2 | ||||
-rwxr-xr-x | tests/xfs/791 | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/generic/724 b/tests/generic/724 index 90cff8cf31..8d7dc4e12a 100755 --- a/tests/generic/724 +++ b/tests/generic/724 @@ -33,9 +33,9 @@ _require_congruent_file_oplen $SCRATCH_MNT 65536 _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full # Create the donor file +$XFS_IO_PROG -f -c 'truncate 1m' $SCRATCH_MNT/b _pwrite_byte 0x59 64k 64k $SCRATCH_MNT/b >> $seqres.full _pwrite_byte 0x57 768k 64k $SCRATCH_MNT/b >> $seqres.full -$XFS_IO_PROG -c 'truncate 1m' $SCRATCH_MNT/b md5sum $SCRATCH_MNT/a | _filter_scratch md5sum $SCRATCH_MNT/b | _filter_scratch diff --git a/tests/xfs/791 b/tests/xfs/791 index c89bc3531e..d82314ee08 100755 --- a/tests/xfs/791 +++ b/tests/xfs/791 @@ -37,9 +37,9 @@ _require_congruent_file_oplen $SCRATCH_MNT 65536 _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full # Create the donor file +$XFS_IO_PROG -f -c 'truncate 1m' $SCRATCH_MNT/b _pwrite_byte 0x59 64k 64k $SCRATCH_MNT/b >> $seqres.full _pwrite_byte 0x57 768k 64k $SCRATCH_MNT/b >> $seqres.full -$XFS_IO_PROG -c 'truncate 1m' $SCRATCH_MNT/b sync md5sum $SCRATCH_MNT/a | _filter_scratch |