dax/dm: disable testing on devices that don't support dax
[xfstests-dev.git] / common / rc
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