diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script
index 0b5d7083..b4f07752 100644
--- a/tests/u_direct_io/script
+++ b/tests/u_direct_io/script
@@ -9,6 +9,11 @@ elif test ! -x $DEBUGFS_EXE; then
 else
     dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1
     LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE)
+    if [ ! -b "$LOOP" ]; then
+        echo "$test_name: $DESCRIPTION: skipped (no loop devices)"
+        rm -f $TMPFILE
+        exit 0
+    fi
     echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT
     $MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \
 	sed -f $cmd_dir/filter.sed >> $OUT
