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)
commit74e99aebdc01646d53b8e78b953c4aa780687586
tree4658b699aa305997a36016f22ec0c73a00d444ec
parentbd5aba84ffdb2cdbc53b535fb8e6ed10ed788f4f
fstests: add missing checks of fallocate feature

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