]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: don't assume preallocation is always supported on XFS
authorChristoph Hellwig <hch@lst.de>
Sat, 10 Nov 2018 11:51:43 +0000 (12:51 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 18 Nov 2018 13:16:42 +0000 (21:16 +0800)
The always_cow mode can't usefull preallocate space gіven that it
always has to write out of place, and thus will reject falloc or
ioctl calls to preallocate space in a file.  Add explicit checks for
preallocation support in various XFS-specific tests to support this.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
24 files changed:
tests/xfs/009
tests/xfs/072
tests/xfs/084
tests/xfs/104
tests/xfs/128
tests/xfs/164
tests/xfs/165
tests/xfs/166
tests/xfs/167
tests/xfs/231
tests/xfs/232
tests/xfs/242
tests/xfs/250
tests/xfs/280
tests/xfs/294
tests/xfs/312
tests/xfs/313
tests/xfs/316
tests/xfs/324
tests/xfs/326
tests/xfs/328
tests/xfs/330
tests/xfs/444
tests/xfs/445

index 7f95156c3b1b8411f0c39630e17f3c09dccc8618..9385d3b9bdf8e5f0c6350fc291c7959f25bd0647 100755 (executable)
@@ -48,6 +48,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_scratch
+_require_xfs_io_command "falloc"
 
 _filesize()
 {
index 735260b7fff6534645608fa1cc8fd2e692a4cba8..f86e4003404bb5bc22d3b67c3dd8f979b47cb963 100755 (executable)
@@ -30,9 +30,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs xfs
 _supported_os Linux
 
-[ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found"
-
 _require_scratch
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 _scratch_unmount >/dev/null 2>&1
index 8e9aff3c6657fe01e12ac61dde0e61a5cf18d4a7..fcdfc18553c99fe5f9ccd08a82f99091bff81fae 100755 (executable)
@@ -35,6 +35,7 @@ pgsize=`$here/src/feature -s`
 # real QA test starts here
 _supported_fs xfs
 _supported_os Linux
+_require_xfs_io_command "falloc"
 _require_test
 
 echo
index 218e2b606bec8734c670b420e49c314f4ce3b751..bc38f9696076af2cde30d723b1c633e5c8816a12 100755 (executable)
@@ -55,6 +55,7 @@ _stress_scratch()
 # real QA test starts here
 _supported_fs xfs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 _scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs
index 40ea0f04ebeb4406e716e6c4c9ab9408debd81cc..f1b4fb4f82f6928dea2994da435e8135436221e8 100755 (executable)
@@ -32,6 +32,7 @@ _supported_fs xfs
 _require_test_lsattr
 _require_scratch_reflink
 _require_cp_reflink
+_require_xfs_io_command "falloc"
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
index fdd9293dffcc33a2e531cb264a845f822edac0cb..b0ec6df5e62cedb00c3e05f677fa031dc8ba05e7 100755 (executable)
@@ -52,6 +52,7 @@ _filter_bmap()
 _supported_fs xfs
 _supported_os Linux
 _require_test
+_require_xfs_io_command "falloc"
 
 testfile=$TEST_DIR/file.$seq
 rm -f $seqres.full
index 4f6738d408c80a6f605650fd9809fcb9c1c2ca45..990d054cf7825d82450adbb341c9b3c35e08ec0c 100755 (executable)
@@ -49,6 +49,7 @@ _filter_bmap()
 _supported_fs xfs
 _supported_os Linux
 _require_test
+_require_xfs_io_command "falloc"
 
 # io tests 
 testfile=$TEST_DIR/file.$seq
index 9814e4a344a689698cada0db7c4bc7a39a2b0e81..8dc7e080cb8645997c26b6b35cffc85448825097 100755 (executable)
@@ -60,6 +60,8 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_scratch
+_require_xfs_io_command "falloc"
+
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index 40b45e8684871e362ce49a42c05bbfe9d9398631..015002d4d71180e9a989ea96e38850c08ea8a161 100755 (executable)
@@ -41,6 +41,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_command "$KILLALL_PROG" killall
+_require_xfs_io_command "falloc"
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
index 865c03312af050b7f51b0c93d41510437c495210..12fdc4905e82fae1ac288195848af0749e077967 100755 (executable)
@@ -38,6 +38,7 @@ _supported_fs xfs
 _require_scratch_reflink
 _require_cp_reflink
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "falloc"
 _require_xfs_io_command "fiemap"
 
 old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime)
index 3a88cc3347e664edcf3c4973de415fce088741fc..e768fa27f08d3eb016aa159c40c8bbe8ed33a85f 100755 (executable)
@@ -39,6 +39,7 @@ _supported_fs xfs
 _require_xfs_io_command "cowextsize"
 _require_scratch_reflink
 _require_cp_reflink
+_require_xfs_io_command "falloc"
 _require_xfs_io_command "fiemap"
 
 old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime)
index 9ae1aebdf2666c6ca97e8b324d6ae745f7b44c8c..5ce2c6f0eccb1da32daa2031932999fd10da2865 100755 (executable)
@@ -31,6 +31,7 @@ _supported_fs xfs
 _supported_os Linux
 _require_test
 
+_require_xfs_io_command "falloc"
 _require_xfs_io_command "zero"
 
 testfile=$TEST_DIR/242.$$
index f8b800e47361be763cfcde20dcdda42c083ee56e..1f4d818ecd93f47233adf30f7f0f533c48008ee4 100755 (executable)
@@ -32,6 +32,7 @@ _supported_fs xfs
 _supported_os Linux
 _require_test
 _require_loop
+_require_xfs_io_command "falloc"
 
 LOOP_DEV=$TEST_DIR/$seq.fs
 LOOP_MNT=$TEST_DIR/$seq.mnt
index 172eee2189385f3b6b5cfe20dfcdd97e41983654..76287c85ba78763dd4eddf5827b580e5c8983720 100755 (executable)
@@ -31,6 +31,7 @@ _supported_os Linux
 _supported_fs xfs
 _require_scratch_reflink
 _require_xfs_io_command "bmap"
+_require_xfs_io_command "falloc"
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
index 4c919432cc678b652169b505e368a44dfc2dc4b5..bce4d07bd175ee7d0fc9697d4694c93217bee72d 100755 (executable)
@@ -42,6 +42,8 @@ _supported_fs xfs
 _supported_os Linux
 _require_scratch
 _require_test_program "punch-alternating"
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fpunch"
 
 # We want to mkfs with a very specific geometry
 MKFS_OPTIONS=""
index cdec92333b18b21003bbd6137acf0f114a2fa41e..fa05754ec7844306e3cd003aea03f64ac522b8ff 100755 (executable)
@@ -34,6 +34,7 @@ _supported_os Linux
 _supported_fs xfs
 _require_cp_reflink
 _require_scratch_reflink
+_require_xfs_io_command "fpunch"
 _require_xfs_io_error_injection "bmap_finish_one"
 
 rm -f $seqres.full
index 47ef7ec8b1f19d00303b662cdbf8a9e866de0714..97c24f0a1f54fe79435d7c35636c09684e477dac 100755 (executable)
@@ -34,6 +34,7 @@ _supported_os Linux
 _supported_fs xfs
 _require_cp_reflink
 _require_scratch_reflink
+_require_xfs_io_command "fpunch"
 _require_xfs_io_error_injection "refcount_finish_one"
 
 rm -f $seqres.full
index d0cd1e2f57ddc4520630c3902fdf06a4432bb555..063f0e43c406917fb68b3acd95bceeaaec94adaa 100755 (executable)
@@ -35,6 +35,7 @@ _supported_fs xfs
 _require_cp_reflink
 _require_scratch_reflink
 _require_error_injection
+_require_xfs_io_command "fpunch"
 _require_xfs_io_error_injection "refcount_continue_update"
 
 rm -f $seqres.full
index a1be33180f087598c5517adc2bb140e91396be9a..e8ed2fc5a013285d769616288ceebaa2095cb7a7 100755 (executable)
@@ -35,6 +35,7 @@ _supported_fs xfs
 _require_cp_reflink
 _require_scratch_reflink
 _require_error_injection
+_require_xfs_io_command "fpunch"
 _require_xfs_io_error_injection "refcount_continue_update"
 
 rm -f $seqres.full
index b6e01862eb0b3dd14e5e96d91fd2398d5d44d906..bb7e55902a2ef5f053ab4467b43c9a607bc28b31 100755 (executable)
@@ -37,6 +37,7 @@ _supported_fs xfs
 _require_cp_reflink
 _require_scratch_reflink
 _require_xfs_io_command "cowextsize"
+_require_xfs_io_command "fpunch"
 _require_xfs_io_error_injection "refcount_finish_one"
 
 rm -f $seqres.full
index ab8af12f58b5e2937e018cc536ba55f6fb72e6a3..55fe3ec941a23c7691be08d235205034ce90ec09 100755 (executable)
@@ -33,6 +33,7 @@ _supported_fs xfs
 _require_scratch_reflink
 _require_cp_reflink
 _require_test_program "punch-alternating"
+_require_xfs_io_command "falloc" # used in FSR
 _require_command "$XFS_FSR_PROG" "xfs_fsr"
 
 rm -f "$seqres.full"
index 3682525dbdafc4ee8e3936d4c61a9bcc1ed9729a..66a9b6e259149888bda9eced7415ca79f6fa18b1 100755 (executable)
@@ -33,6 +33,7 @@ _supported_os Linux
 _supported_fs xfs
 _require_scratch_reflink
 _require_cp_reflink
+_require_xfs_io_command "falloc" # used in FSR
 _require_command "$XFS_FSR_PROG" "xfs_fsr"
 _require_quota
 _require_nobody
index f1c0ed03dc4bb9e19199ea0cdeed0ed9f27dddee..7a33b9e9da430028a725f03efbf32400ce286717 100755 (executable)
@@ -38,6 +38,7 @@ _supported_os Linux
 _require_check_dmesg
 _require_scratch
 _require_test_program "punch-alternating"
+_require_xfs_io_command "falloc"
 _require_xfs_db_write_array
 
 # This is only a v5 filesystem problem
index 2d205a40209a4b7d9af9d8fe5e60c04e17167915..800d5d28eece5fad63e86f2d323f951376334eb1 100755 (executable)
@@ -53,6 +53,7 @@ drop_caches()
 _supported_fs generic
 _supported_os Linux
 _require_scratch_size $((2*1024*1024)) # kb
+_require_xfs_io_command "falloc"
 
 # check for filestreams
 _check_filestreams_support || _notrun "filestreams not available"