common: ext4's data=journal mode doesn't support O_DIRECT
PATCH 1/1 common: ext4's data=journal mode doesn't support O_DIRECT
Teach _require_odirect that ext4's data=journal mode doesn't support O_DIRECT.
--- common/rc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
common/rc +7 -3
@@ -1932,9 +1932,13 @@ _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" + if [ $FSTYP = "ext4" ] ; then + if echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption" ; then + _notrun "ext4 encryption doesn't support O_DIRECT" + fi + if echo "$MOUNT_OPTIONS" | grep -q "data=journal" ; then + _notrun "ext4 data=journal mode 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
Signature · 1 line
2.5.0
Quoted 16 lines · Theodore Ts'o
Teach
_require_odirectthat ext4's data=journal mode doesn't supportO_DIRECT.Signed-off-by Theodore Ts'o <[email protected]>--- common/rc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)common/rc +0
-0@@ -1932,9 +1932,13 @@ _require_xfs_db_command() # check that kernel and filesystem support direct I/O _require_odirect() {
common/rc _require_xfs_db_command() · line 1941
Quoted 10 lines
common/rc +7
-3- if [ $FSTYP = "ext4" ] && - echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption" ; then - _notrun "ext4 encryption doesn't support O_DIRECT" + if [ $FSTYP = "ext4" ] ; then + if echo "$MOUNT_OPTIONS" | grep -q "test_dummy_encryption" ; then + _notrun "ext4 encryption doesn't support O_DIRECT" + fi + if echo "$MOUNT_OPTIONS" | grep -q "data=journal" ; then + _notrun "ext4 data=journal mode doesn't support O_DIRECT" + fi
This hunk doesn't apply, there's no detection code for ext4 encryption in current master. And do we need to filter out ext3 journal mode as well?
And this patch mixed space and tab for indention.
Just curious, what's the problem running direct I/O tests on journal mode ext4? ext4 falls back to buffered I/O in this case and I don't see any test failures caused by it. Perhaps it'd be better to add this information to commit log too.
Thanks,
Eryu
Quoted 10 lines
common/rc +0
-0fi testfile=$TEST_DIR/$$.direct $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile > /dev/null 2>&1Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Eryu Guan
This hunk doesn't apply, there's no detection code for ext4 encryption in current master. And do we need to filter out ext3 journal mode as well?
Oops, there's another patch this depends upon that I forgot to send out this time around. Let me fix up the spaces and tabs, and probably just combine the two patches.
Quoted 4 lines
Just curious, what's the problem running direct I/O tests on journal mode ext4? ext4 falls back to buffered I/O in this case and I don't see any test failures caused by it. Perhaps it'd be better to add this information to commit log too.
I'll double check but I think there was at least one dmflaky that failed (or maybe it was just flaky) because the DIO write wasn't really DIO, and if the device went read-only too early, the data write wouldn't make it to the disk, and this caused the test failure.
More generally, if a particular file system mode doesn't support Direct I/O, even if it doesn't cause a test failure, it's likely a waste of test resources to run a test which expected that writes be DIO when it really isn't.
- Ted