@@ -1748,6 +1748,19 @@ _require_scratch_16T_support()
esac
}
+# Require scratch fs supports delay allocation.
+_require_scratch_delalloc()
+{
+ _require_command "$FILEFRAG_PROG" filefrag
+
+ _scratch_mkfs > $seqres.full
+ _scratch_mount
+ $XFS_IO_PROG -f -c 'pwrite 0 64k' $SCRATCH_MNT/testy &> /dev/null
+ $FILEFRAG_PROG -v $SCRATCH_MNT/testy 2>&1 | grep -q delalloc || \
+ _notrun "test requires delayed allocation buffered writes"
+ _scratch_unmount
+}
+
# this test needs a test partition - check we're ok & mount it
#
_require_test()
@@ -28,6 +28,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_odirect
@@ -28,6 +28,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
@@ -31,6 +31,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "fpunch"
_require_cp_reflink
@@ -31,6 +31,7 @@ _cleanup()
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "fpunch"
_require_cp_reflink
@@ -24,6 +24,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
@@ -24,6 +24,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_odirect
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
@@ -26,6 +26,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_supported_fs generic
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
echo "Format and mount"
@@ -16,7 +16,6 @@ _begin_fstest rw filestreams
# real QA test starts here
_supported_fs xfs
-_require_command "$FILEFRAG_PROG" filefrag
_require_scratch
# The first _test_streams call sets up the filestreams allocator to fail and
@@ -36,16 +35,7 @@ _require_scratch
# rescan thresholds and will keep pushing out the expiration time, with the
# result that the filestreams allocator succeeds in maintaining the streams.
# The test considers this a failure.
-#
-# Make sure that a regular buffered write produces delalloc reservations.
-# This effectively disables the test for files with extent size hints or DAX
-# mode set.
-_scratch_mkfs > $seqres.full
-_scratch_mount
-$XFS_IO_PROG -f -c 'pwrite 0 64k' $SCRATCH_MNT/testy &> /dev/null
-$FILEFRAG_PROG -v $SCRATCH_MNT/testy 2>&1 | grep -q delalloc || \
- _notrun "test requires delayed allocation buffered writes"
-_scratch_unmount
+_require_scratch_delalloc
_check_filestreams_support || _notrun "filestreams not available"
@@ -22,6 +22,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_odirect
@@ -22,6 +22,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone punch
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "fpunch"
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone punch
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "fpunch"
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
@@ -25,6 +25,7 @@ _begin_fstest auto quick clone
# real QA test starts here
_require_scratch_reflink
+_require_scratch_delalloc
_require_xfs_io_command "falloc"
_require_xfs_io_command "cowextsize"
_require_odirect
Check whether delalloc is supported on current device. Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com> --- common/rc | 13 +++++++++++++ tests/generic/194 | 1 + tests/generic/195 | 1 + tests/generic/199 | 1 + tests/generic/200 | 1 + tests/generic/293 | 1 + tests/generic/295 | 1 + tests/generic/540 | 1 + tests/generic/541 | 1 + tests/generic/542 | 1 + tests/generic/543 | 1 + tests/xfs/172 | 12 +----------- tests/xfs/223 | 1 + tests/xfs/224 | 1 + tests/xfs/228 | 1 + tests/xfs/230 | 1 + tests/xfs/257 | 1 + tests/xfs/258 | 1 + 18 files changed, 30 insertions(+), 11 deletions(-)