Mark tests which use direct I/O with _requires_odirect
PATCH 1/2 Mark tests which use direct I/O with _requires_odirect
There were a number of tests that use Direct I/O that weren't testing to make sure O_DIRECT is actually supported. This will be important for avoiding false positives when testing ext4 encryption (which does not support DIO for obvious reasons).
Signed-off-by Theodore Ts'o <[email protected]>
--- tests/ext4/301 | 1 + tests/ext4/302 | 1 + tests/ext4/303 | 1 + tests/ext4/304 | 1 + tests/generic/095 | 1 + tests/generic/250 | 1 + tests/generic/252 | 2 +- tests/generic/331 | 2 +- tests/generic/332 | 2 +- 9 files changed, 9 insertions(+), 3 deletions(-)
tests/ext4/301 +1 -0
@@ -42,6 +42,7 @@ _supported_os Linux _supported_fs ext4 _require_scratch _require_defrag +_require_odirect NUM_JOBS=$((4*LOAD_FACTOR)) BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
tests/ext4/302 +1 -0
@@ -43,6 +43,7 @@ _supported_os Linux _supported_fs ext4 _require_scratch _require_defrag +_require_odirect BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` # We need space for 2 files (test file, and donor one)
tests/ext4/303 +1 -0
@@ -43,6 +43,7 @@ _supported_os Linux _supported_fs ext4 _require_scratch _require_defrag +_require_odirect BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` # We need space for 3 files (one donor file and two test files)
tests/ext4/304 +1 -0
@@ -44,6 +44,7 @@ _supported_os Linux _supported_fs ext4 _require_scratch _require_defrag +_require_odirect BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` # We need space for 2 files (test file, and donor one)
tests/generic/095 +1 -0
@@ -44,6 +44,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_odirect iodepth=$((16 * LOAD_FACTOR)) iodepth_batch=$((8 * LOAD_FACTOR))
tests/generic/250 +1 -0
@@ -47,6 +47,7 @@ _supported_os Linux _require_scratch _require_dm_target error _require_xfs_io_command "falloc" +_require_odirect rm -f $seqres.full
tests/generic/252 +1 -1
@@ -47,7 +47,7 @@ _supported_os Linux _require_scratch _require_dm_target error _require_xfs_io_command "falloc" -_require_test_program "aio-dio-regress/aiocp" +_require_aiodio "aiocp" AIO_TEST="src/aio-dio-regress/aiocp" rm -f $seqres.full
tests/generic/331 +1 -1
@@ -47,7 +47,7 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink _require_dm_target error -_require_test_program "aio-dio-regress/aiocp" +_require_aiodio "aiocp" AIO_TEST="src/aio-dio-regress/aiocp" rm -f $seqres.full
tests/generic/332 +1 -1
@@ -44,7 +44,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink -_require_test_program "aio-dio-regress/aiocp" +_require_aiodio "aiocp" AIO_TEST="src/aio-dio-regress/aiocp" rm -f $seqres.full
Signature · 1 line
2.5.0
PATCH 2/2 common: teach _require_odirect that ext4 encryption doesn't support DIO
Signed-off-by Theodore Ts'o <[email protected]>
--- common/rc | 4 ++++ 1 file changed, 4 insertions(+)
common/rc +4 -0
@@ -1916,6 +1916,10 @@ _require_xfs_db_command() # check that kernel and filesystem support direct I/O _require_odirect() { + if [ $FSTYP = "ext4" ] && + echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption" ; then + _notrun "ext4 encryption doesn't support O_DIRECT" + fi testfile=$TEST_DIR/$$.direct $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1 if [ $? -ne 0 ]; then
Signature · 1 line
2.5.0
Re: [PATCH 2/2] common: teach _require_odirect that ext4 encryption doesn't support DIO
Quoted 10 lines · Theodore Ts'o
Signed-off-by Theodore Ts'o <[email protected]>--- common/rc | 4 ++++ 1 file changed, 4 insertions(+)common/rc +0
-0
common/rc _require_xfs_db_command() · line 1924
Quoted 9 lines
common/rc +4
-0@@ -1916,6 +1916,10 @@ _require_xfs_db_command() # check that kernel and filesystem support direct I/O _require_odirect() { + if [ $FSTYP = "ext4" ] && + echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption" ; then + _notrun "ext4 encryption doesn't support O_DIRECT" + fi testfile=$TEST_DIR/$$.direct $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1
Why isn't the direct IO failing here with an error sufficient to prevent the test from running?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]