From: Christoph Hellwig Date: Sat, 10 Nov 2018 11:51:43 +0000 (+0100) Subject: xfs: don't assume preallocation is always supported on XFS X-Git-Tag: v2022.05.01~1333 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=09e94f84d929ca21f9557197d92fe32644d7b53f;p=users%2Fhch%2Fxfstests-dev.git xfs: don't assume preallocation is always supported on XFS 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/xfs/009 b/tests/xfs/009 index 7f95156c3..9385d3b9b 100755 --- a/tests/xfs/009 +++ b/tests/xfs/009 @@ -48,6 +48,7 @@ _supported_fs xfs _supported_os Linux _require_scratch +_require_xfs_io_command "falloc" _filesize() { diff --git a/tests/xfs/072 b/tests/xfs/072 index 735260b7f..f86e40034 100755 --- a/tests/xfs/072 +++ b/tests/xfs/072 @@ -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 diff --git a/tests/xfs/084 b/tests/xfs/084 index 8e9aff3c6..fcdfc1855 100755 --- a/tests/xfs/084 +++ b/tests/xfs/084 @@ -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 diff --git a/tests/xfs/104 b/tests/xfs/104 index 218e2b606..bc38f9696 100755 --- a/tests/xfs/104 +++ b/tests/xfs/104 @@ -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 diff --git a/tests/xfs/128 b/tests/xfs/128 index 40ea0f04e..f1b4fb4f8 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -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 diff --git a/tests/xfs/164 b/tests/xfs/164 index fdd9293df..b0ec6df5e 100755 --- a/tests/xfs/164 +++ b/tests/xfs/164 @@ -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 diff --git a/tests/xfs/165 b/tests/xfs/165 index 4f6738d40..990d054cf 100755 --- a/tests/xfs/165 +++ b/tests/xfs/165 @@ -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 diff --git a/tests/xfs/166 b/tests/xfs/166 index 9814e4a34..8dc7e080c 100755 --- a/tests/xfs/166 +++ b/tests/xfs/166 @@ -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 diff --git a/tests/xfs/167 b/tests/xfs/167 index 40b45e868..015002d4d 100755 --- a/tests/xfs/167 +++ b/tests/xfs/167 @@ -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 diff --git a/tests/xfs/231 b/tests/xfs/231 index 865c03312..12fdc4905 100755 --- a/tests/xfs/231 +++ b/tests/xfs/231 @@ -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) diff --git a/tests/xfs/232 b/tests/xfs/232 index 3a88cc334..e768fa27f 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -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) diff --git a/tests/xfs/242 b/tests/xfs/242 index 9ae1aebdf..5ce2c6f0e 100755 --- a/tests/xfs/242 +++ b/tests/xfs/242 @@ -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.$$ diff --git a/tests/xfs/250 b/tests/xfs/250 index f8b800e47..1f4d818ec 100755 --- a/tests/xfs/250 +++ b/tests/xfs/250 @@ -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 diff --git a/tests/xfs/280 b/tests/xfs/280 index 172eee218..76287c85b 100755 --- a/tests/xfs/280 +++ b/tests/xfs/280 @@ -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 diff --git a/tests/xfs/294 b/tests/xfs/294 index 4c919432c..bce4d07bd 100755 --- a/tests/xfs/294 +++ b/tests/xfs/294 @@ -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="" diff --git a/tests/xfs/312 b/tests/xfs/312 index cdec92333..fa05754ec 100755 --- a/tests/xfs/312 +++ b/tests/xfs/312 @@ -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 diff --git a/tests/xfs/313 b/tests/xfs/313 index 47ef7ec8b..97c24f0a1 100755 --- a/tests/xfs/313 +++ b/tests/xfs/313 @@ -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 diff --git a/tests/xfs/316 b/tests/xfs/316 index d0cd1e2f5..063f0e43c 100755 --- a/tests/xfs/316 +++ b/tests/xfs/316 @@ -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 diff --git a/tests/xfs/324 b/tests/xfs/324 index a1be33180..e8ed2fc5a 100755 --- a/tests/xfs/324 +++ b/tests/xfs/324 @@ -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 diff --git a/tests/xfs/326 b/tests/xfs/326 index b6e01862e..bb7e55902 100755 --- a/tests/xfs/326 +++ b/tests/xfs/326 @@ -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 diff --git a/tests/xfs/328 b/tests/xfs/328 index ab8af12f5..55fe3ec94 100755 --- a/tests/xfs/328 +++ b/tests/xfs/328 @@ -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" diff --git a/tests/xfs/330 b/tests/xfs/330 index 3682525db..66a9b6e25 100755 --- a/tests/xfs/330 +++ b/tests/xfs/330 @@ -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 diff --git a/tests/xfs/444 b/tests/xfs/444 index f1c0ed03d..7a33b9e9d 100755 --- a/tests/xfs/444 +++ b/tests/xfs/444 @@ -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 diff --git a/tests/xfs/445 b/tests/xfs/445 index 2d205a402..800d5d28e 100755 --- a/tests/xfs/445 +++ b/tests/xfs/445 @@ -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"