common/rc: Remove special handing of 'dup' argument for btrfs
[xfstests-dev.git] / common / rc
index 827fa8826202114fc8bd7498925d457c7cea4255..cfaabf10ecd90885c8f30f5d18519092c26e20b9 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -885,13 +885,7 @@ _scratch_pool_mkfs()
 {
     case $FSTYP in
     btrfs)
-        # if dup profile is in mkfs options call _scratch_mkfs instead
-        # because dup profile only works with single device
-        if [[ "$*" =~ dup ]]; then
-            _scratch_mkfs $*
-        else
-            $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV_POOL > /dev/null
-        fi
+        $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV_POOL > /dev/null
         ;;
     *)
         echo "_scratch_pool_mkfs is not implemented for $FSTYP" 1>&2
@@ -2105,9 +2099,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 +2346,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*)
@@ -3093,7 +3094,7 @@ _require_scratch_shutdown()
                        # SCRATCH_DEV, in this case OVL_BASE_SCRATCH_DEV
                        # will be null, so check OVL_BASE_SCRATCH_DEV before
                        # running shutdown to avoid shutting down base fs accidently.
-                       _notrun "$SCRATCH_DEV is not a block device"
+                       _notrun "This test requires a valid $OVL_BASE_SCRATCH_DEV as ovl base fs"
                else
                        src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \
                        || _notrun "Underlying filesystem does not support shutdown"
@@ -4038,6 +4039,14 @@ _try_wipe_scratch_devs()
 {
        test -x "$WIPEFS_PROG" || return 0
 
+       # Do specified filesystem wipe at first
+       case "$FSTYP" in
+       "xfs")
+               _try_wipe_scratch_xfs
+               ;;
+       esac
+
+       # Then do wipefs on all scratch devices
        for dev in $SCRATCH_DEV_POOL $SCRATCH_DEV $SCRATCH_LOGDEV $SCRATCH_RTDEV; do
                test -b $dev && $WIPEFS_PROG -a $dev
        done