diff mbox series

generic/591: tmpfs do not test with O_DIRECT flag

Message ID 20210409103800.2077384-1-sunke32@huawei.com (mailing list archive)
State New
Headers show
Series generic/591: tmpfs do not test with O_DIRECT flag | expand

Commit Message

Sun Ke April 9, 2021, 10:38 a.m. UTC
tmpfs does not support the O_DIRECT flag, so when FSTYP is tmpfs,
do not test with O_DIRECT flag.

Signed-off-by: Sun Ke <sunke32@huawei.com>
---
 tests/generic/591 | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Comments

Eryu Guan April 11, 2021, 8:48 a.m. UTC | #1
On Fri, Apr 09, 2021 at 06:38:00AM -0400, Sun Ke wrote:
> tmpfs does not support the O_DIRECT flag, so when FSTYP is tmpfs,
> do not test with O_DIRECT flag.
> 
> Signed-off-by: Sun Ke <sunke32@huawei.com>

Seems we should add _require_odirect instead, otherwise we'll keep
adding new checks when new filesystems without dio support emerge.

Thanks,
Eryu

> ---
>  tests/generic/591 | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/591 b/tests/generic/591
> index d4020463..4b97a2fc 100755
> --- a/tests/generic/591
> +++ b/tests/generic/591
> @@ -31,10 +31,18 @@ _require_test_program "splice-test"
>  
>  rm -f $seqres.full
>  
> -$here/src/splice-test -r $TEST_DIR/a
> -$here/src/splice-test -rd $TEST_DIR/a
> -$here/src/splice-test $TEST_DIR/a
> -$here/src/splice-test -d $TEST_DIR/a
> +if [ $FSTYP == "tmpfs" ]; then
> +	echo "concurrent reader with O_DIRECT"
> +	echo "concurrent reader with O_DIRECT"
> +	$here/src/splice-test -rd $TEST_DIR/a
> +	echo "sequential reader with O_DIRECT"
> +	$here/src/splice-test -d $TEST_DIR/a
> +else
> +	$here/src/splice-test -r $TEST_DIR/a
> +	$here/src/splice-test -rd $TEST_DIR/a
> +	$here/src/splice-test $TEST_DIR/a
> +	$here/src/splice-test -d $TEST_DIR/a
> +fi
>  
>  # success, all done
>  status=0
> -- 
> 2.13.6
diff mbox series

Patch

diff --git a/tests/generic/591 b/tests/generic/591
index d4020463..4b97a2fc 100755
--- a/tests/generic/591
+++ b/tests/generic/591
@@ -31,10 +31,18 @@  _require_test_program "splice-test"
 
 rm -f $seqres.full
 
-$here/src/splice-test -r $TEST_DIR/a
-$here/src/splice-test -rd $TEST_DIR/a
-$here/src/splice-test $TEST_DIR/a
-$here/src/splice-test -d $TEST_DIR/a
+if [ $FSTYP == "tmpfs" ]; then
+	echo "concurrent reader with O_DIRECT"
+	echo "concurrent reader with O_DIRECT"
+	$here/src/splice-test -rd $TEST_DIR/a
+	echo "sequential reader with O_DIRECT"
+	$here/src/splice-test -d $TEST_DIR/a
+else
+	$here/src/splice-test -r $TEST_DIR/a
+	$here/src/splice-test -rd $TEST_DIR/a
+	$here/src/splice-test $TEST_DIR/a
+	$here/src/splice-test -d $TEST_DIR/a
+fi
 
 # success, all done
 status=0