generic/564: fix copy_range -f availability test
[xfstests-dev.git] / common / rc
index 827fa8826202114fc8bd7498925d457c7cea4255..66c7fd4d7a6c4c09b6a7ab5a4f6f067d0ccf8cf7 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2105,9 +2105,16 @@ _require_xfs_io_command()
                ;;
        "copy_range")
                local testcopy=$TEST_DIR/$$.copy.xfs_io
+               local copy_opts=$testfile
+               if [ "$param" == "-f" ]; then
+                       # source file is the open destination file
+                       testcopy=$testfile
+                       copy_opts="0 -d 4k -l 4k"
+               fi
                $XFS_IO_PROG -F -f -c "pwrite 0 4k" $testfile > /dev/null 2>&1
-               testio=`$XFS_IO_PROG -F -f -c "copy_range $testfile" $testcopy 2>&1`
+               testio=`$XFS_IO_PROG -F -f -c "copy_range $param $copy_opts" $testcopy 2>&1`
                rm -f $testcopy > /dev/null 2>&1
+               param_checked="$param"
                ;;
        "falloc" )
                testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1`
@@ -2345,7 +2352,7 @@ _fstyp_has_non_default_seek_data_hole()
        fi
 
        case "$fstyp" in
-       btrfs|ext4|xfs|ceph|cifs|f2fs|gfs2|ocfs2|tmpfs)
+       btrfs|ext4|xfs|cifs|f2fs|gfs2|ocfs2|tmpfs)
                return 0
                ;;
        nfs*)