* [PATCH] common: ext4 doesn't support O_DIRECT with encryption
@ 2016-06-29 1:32 Theodore Ts'o
2016-06-29 9:39 ` Eryu Guan
2016-07-01 1:45 ` Dave Chinner
0 siblings, 2 replies; 3+ messages in thread
From: Theodore Ts'o @ 2016-06-29 1:32 UTC (permalink / raw)
To: fstests; +Cc: Theodore Ts'o
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>
---
common/rc | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/common/rc b/common/rc
index adda940..003400d 100644
--- a/common/rc
+++ b/common/rc
@@ -1933,12 +1933,18 @@ _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)
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] common: ext4 doesn't support O_DIRECT with encryption
2016-06-29 1:32 [PATCH] common: ext4 doesn't support O_DIRECT with encryption Theodore Ts'o
@ 2016-06-29 9:39 ` Eryu Guan
2016-07-01 1:45 ` Dave Chinner
1 sibling, 0 replies; 3+ messages in thread
From: Eryu Guan @ 2016-06-29 9:39 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: fstests
On Tue, Jun 28, 2016 at 09:32:55PM -0400, Theodore Ts'o wrote:
> 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>
> ---
> common/rc | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index adda940..003400d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1933,12 +1933,18 @@ _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
I moved 'then' to the end of above line (if ....; then) and queued it up
Reviewed-by: Eryu Guan <eguan@redhat.com>
> + _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)
> --
> 2.5.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] common: ext4 doesn't support O_DIRECT with encryption
2016-06-29 1:32 [PATCH] common: ext4 doesn't support O_DIRECT with encryption Theodore Ts'o
2016-06-29 9:39 ` Eryu Guan
@ 2016-07-01 1:45 ` Dave Chinner
1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2016-07-01 1:45 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: fstests
On Tue, Jun 28, 2016 at 09:32:55PM -0400, Theodore Ts'o wrote:
> 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.
Stupid question: why isn't ext4 simply falling back to buffered IO
when encryption is enabled on a file? This seems kind of strange to
have direct IO conditionally supported based on mkfs/mount
parameters (or perhaps even per-file configurations)....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-01 1:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29 1:32 [PATCH] common: ext4 doesn't support O_DIRECT with encryption Theodore Ts'o
2016-06-29 9:39 ` Eryu Guan
2016-07-01 1:45 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox