fstests: add missing checks of fallocate feature
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 23 Apr 2021 11:26:31 +0000 (20:26 +0900)
committerEryu Guan <guaneryu@gmail.com>
Sun, 25 Apr 2021 08:20:43 +0000 (16:20 +0800)
Many test cases use xfs_io -c 'falloc' but forgot to add
_require_xfs_io_command "falloc". This will fail the test case if we
run the test case on a file system without fallcoate support e.g.
F2FS.

While we believe that normal fallocate(mode = 0) is always supported
on Linux, it is not true. Fallocate is disabled in several
implementations of zoned block support for file systems because the
pre-allocated region will break the sequential writing rule.

Currently, several test cases unconditionally call fallocate().
Let's add _require_xfs_io_command "falloc" to properly check the
feature is supported by a testing file system.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
17 files changed:
tests/btrfs/013
tests/btrfs/016
tests/btrfs/025
tests/btrfs/034
tests/btrfs/037
tests/btrfs/046
tests/btrfs/107
tests/ext4/001
tests/f2fs/001
tests/generic/456
tests/xfs/042
tests/xfs/114
tests/xfs/118
tests/xfs/331
tests/xfs/341
tests/xfs/342
tests/xfs/423

index 9252c82a207692cd97f0100817a749387e78b34d..5e03ed4a4b4ba418d5fc76b78d59dffa7847a0ad 100755 (executable)
@@ -33,6 +33,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs btrfs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 
index 8fd237cbdb641fdc523fda3d51abf1bf69a2cf5d..015ec17f93d6e4e367d1797cdbd390ed084fc303 100755 (executable)
@@ -35,6 +35,7 @@ _supported_fs btrfs
 _require_test
 _require_scratch
 _require_fssum
+_require_xfs_io_command "falloc"
 
 _scratch_mkfs > /dev/null 2>&1
 
index 42cd7cefe825713434b4e23663a70b80dfa43882..5c8140552bfbf8661d79a0e0cbd77fd17b16bc78 100755 (executable)
@@ -31,6 +31,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs btrfs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 
index bc7a4aae3886a9f7da9ddc9b4668c6a2b11eda99..07c84c347d3be18f1be50c93979f891cc7de0d28 100755 (executable)
@@ -28,6 +28,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs btrfs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 
index 1cfaf5be58c83ad6c89b0194ccda0933d75bf7ef..9ef199a93413c7e1d4839001ee9630bbd66f59e3 100755 (executable)
@@ -35,6 +35,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs btrfs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 
index 882db8eacc4ed7f31fb58fc3c7214fb774d5e521..a1d82e1cdd5470b1f1fa25a9221ca70c5db29f84 100755 (executable)
@@ -37,6 +37,7 @@ _cleanup()
 _supported_fs btrfs
 _require_test
 _require_scratch
+_require_xfs_io_command "falloc"
 _require_fssum
 
 rm -f $seqres.full
index e57c9dead4996639bb273ded5a9e348020106c54..80db5ab9822d3b2e525706716af19bf3569d309e 100755 (executable)
@@ -34,6 +34,7 @@ rm -f $seqres.full
 
 _supported_fs btrfs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 # Use 64K file size to match any sectorsize
 # And with a unaligned tailing range to ensure it will be at least 2 pages
index bbb74f1ea5bc502494a986c5ee20dcc31101a7ae..9650303d15b56313dce39f1b55b357b777de0c7b 100755 (executable)
@@ -29,6 +29,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 
 # real QA test starts here
 _supported_fs ext4
+_require_xfs_io_command "falloc"
 _require_xfs_io_command "fzero"
 _require_test
 
index 98bd2682d60f2591ff00107c060796e94f84c70d..0753a09b557653aa9e3a6f0eba90d2b5fbc79697 100755 (executable)
@@ -36,6 +36,7 @@ _cleanup()
 
 _supported_fs f2fs
 _require_scratch
+_require_xfs_io_command "falloc"
 
 testfile=$SCRATCH_MNT/testfile
 dummyfile=$SCRATCH_MNT/dummyfile
index 2f9df5e5edc4a792b967b326562b855eaa961ff7..65667d449dd36b3c28c557c463d09962595f820e 100755 (executable)
@@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs generic
 _require_scratch
+_require_xfs_io_command "falloc"
 _require_dm_target flakey
 _require_xfs_io_command "falloc" "-k"
 _require_xfs_io_command "fzero"
index b55d642c5170c6cb2d38aaf9575cfe615cec1388..fcd5181cf590aee7a928e7fc89fffab5a6d71861 100755 (executable)
@@ -31,6 +31,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 
 # real QA test starts here
 _supported_fs xfs
+_require_xfs_io_command "falloc"
 
 _require_scratch
 
index b936452461c630296c0675dada54e001846a1df6..3f5575a61dfbcc00f03ac943a12f50f15b1fa029 100755 (executable)
@@ -32,6 +32,7 @@ _cleanup()
 _supported_fs xfs
 _require_test_program "punch-alternating"
 _require_xfs_scratch_rmapbt
+_require_xfs_io_command "falloc"
 _require_xfs_io_command "fcollapse"
 _require_xfs_io_command "finsert"
 
index 5e23617b39ddb767b0beb035aaa9f6e67b62c0d4..9a431821aa6265aa71a4838dd6ac9c3200331fd6 100755 (executable)
@@ -41,6 +41,7 @@ _supported_fs xfs
 
 _require_scratch
 _require_command "$XFS_FSR_PROG" "xfs_fsr"
+_require_xfs_io_command "falloc"
 
 # 50M
 _scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1
index 4ea54e2a534b8d07bd202c1c531ce649b3960a5e..8e92b2e36a8dda24004bd7cf6a5bd8dc88265f51 100755 (executable)
@@ -33,6 +33,7 @@ _require_xfs_scratch_rmapbt
 _require_scratch_reflink
 _require_xfs_io_command "falloc"
 _require_test_program "punch-alternating"
+_require_xfs_io_command "falloc"
 
 rm -f "$seqres.full"
 
index e1fbe588d9eb47d452d69b2903610b7e3cdae91c..8bf05087e1babda967862c3e2d7faa34895929c2 100755 (executable)
@@ -31,6 +31,7 @@ _require_realtime
 _require_xfs_scratch_rmapbt
 _require_test_program "punch-alternating"
 _disable_dmesg_check
+_require_xfs_io_command "falloc"
 
 rm -f "$seqres.full"
 
index 2be5f7698f0146130b390585d48d1d86db201fb2..4db222d65fb24423b434eaf1e134a2e0728625ab 100755 (executable)
@@ -30,6 +30,7 @@ _supported_fs xfs
 _require_realtime
 _require_xfs_scratch_rmapbt
 _require_test_program "punch-alternating"
+_require_xfs_io_command "falloc"
 
 rm -f "$seqres.full"
 
index 8d51a9a605851218cb95a2939ff941e927e28411..183c9cf5ededff5242999f9c64122617ba497d80 100755 (executable)
@@ -35,6 +35,7 @@ _cleanup()
 _supported_fs xfs
 _require_test_program "punch-alternating"
 _require_xfs_io_command "scrub"
+_require_xfs_io_command "falloc"
 _require_scratch
 
 echo "Format and populate"