mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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 <hch@lst.de> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
31735e301e
commit
09e94f84d9
@@ -48,6 +48,7 @@ _supported_fs xfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_scratch
|
||||
_require_xfs_io_command "falloc"
|
||||
|
||||
_filesize()
|
||||
{
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.$$
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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=""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user