]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: ext4 doesn't support O_DIRECT with encryption
authorTheodore Ts'o <tytso@mit.edu>
Wed, 29 Jun 2016 01:32:55 +0000 (21:32 -0400)
committerEryu Guan <eguan@redhat.com>
Thu, 30 Jun 2016 15:02:52 +0000 (23:02 +0800)
Teach _require_odirect to skip the O_DIRECT tests if the ext4 mount
option "test_dummy_encryption" is enabled, since O_DIRECT doesen't
make sense when file system level encryption is enabled, and several
tests which use O_DIRECT --- ext4/301, ext4/304, generic/250 and
generic/252 --- fail when encryption is enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc

index 883bd7b9ce9a7d3ea40aaeddb5f81e75ebbab343..32fa8f2bfeb60c03f68cf0fde835938778d40966 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1928,12 +1928,17 @@ _require_xfs_db_command()
 # check that kernel and filesystem support direct I/O
 _require_odirect()
 {
-       testfile=$TEST_DIR/$$.direct
-       $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               _notrun "O_DIRECT is not supported"
-       fi
-       rm -f $testfile 2>&1 > /dev/null
+       if [ $FSTYP = "ext4" ] ; then
+               if echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption"; then
+                       _notrun "ext4 encryption doesn't support O_DIRECT"
+               fi
+       fi
+       testfile=$TEST_DIR/$$.direct
+       $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               _notrun "O_DIRECT is not supported"
+       fi
+       rm -f $testfile 2>&1 > /dev/null
 }
 
 # Check that a fs has enough free space (in 1024b blocks)