dax/dm: disable testing on devices that don't support dax
authorJeff Moyer <jmoyer@redhat.com>
Thu, 20 Feb 2020 20:06:30 +0000 (15:06 -0500)
committerEryu Guan <guaneryu@gmail.com>
Fri, 6 Mar 2020 07:55:39 +0000 (15:55 +0800)
Move the check for dax from the individual target scripts into
_require_dm_target.  This fixes up a couple of missed tests that are
failing due to the lack of dax support (such as tests requiring
dm-snapshot).

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/dmdelay
common/dmerror
common/dmflakey
common/dmthin
common/rc

index f1e725b943b9ef06e912cfe5d206947ba9d2aa5d..66cac1a70c14c89839ce483aeae8a854191d44ce 100644 (file)
@@ -7,11 +7,6 @@
 DELAY_NONE=0
 DELAY_READ=1
 
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
-       _notrun "Cannot run tests with DAX on dmdelay devices"
-fi
-
 _init_delay()
 {
        local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
index 426f1e96d3a151b1d57074fa6e1abdc0740fd27b..7d12e0a1843cd6c21ac5ddc3207bb9470f8dee69 100644 (file)
@@ -4,11 +4,6 @@
 #
 # common functions for setting up and tearing down a dmerror device
 
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
-       _notrun "Cannot run tests with DAX on dmerror devices"
-fi
-
 _dmerror_setup()
 {
        local dm_backing_dev=$SCRATCH_DEV
index 2af3924d44d2cedd98e7d56d69266ca29f26bd75..b4e11ae9c74aaba9dbf4c97c60e77a83255badae 100644 (file)
@@ -8,11 +8,6 @@ FLAKEY_ALLOW_WRITES=0
 FLAKEY_DROP_WRITES=1
 FLAKEY_ERROR_WRITES=2
 
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
-       _notrun "Cannot run tests with DAX on dmflakey devices"
-fi
-
 _init_flakey()
 {
        local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
index 7946e9a7c0fc0e23532335eb509729a2799a38af..61dd6f8913b1ef177415923e9d52f7b5a14730b3 100644 (file)
@@ -21,11 +21,6 @@ DMTHIN_POOL_DEV="/dev/mapper/$DMTHIN_POOL_NAME"
 DMTHIN_VOL_NAME="thin-vol"
 DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME"
 
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
-       _notrun "Cannot run tests with DAX on dmthin devices"
-fi
-
 _dmthin_cleanup()
 {
        $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
index 0306e93cb1caaf6ba5abf92d0f765a62f1c0786d..454f5ccf56f0b9992f24b15a90f8466a2d69ca4f 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1874,6 +1874,17 @@ _require_dm_target()
        _require_sane_bdev_flush $SCRATCH_DEV
        _require_command "$DMSETUP_PROG" dmsetup
 
+       echo $MOUNT_OPTIONS | grep -q dax
+       if [ $? -eq 0 ]; then
+               case $target in
+               stripe|linear|log-writes)
+                       ;;
+               *)
+                       _notrun "Cannot run tests with DAX on $target devices."
+                       ;;
+               esac
+       fi
+
        modprobe dm-$target >/dev/null 2>&1
 
        $DMSETUP_PROG targets 2>&1 | grep -q ^$target