FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] generic/591: tmpfs do not test with O_DIRECT flag
@ 2021-04-09 10:38 Sun Ke
  2021-04-11  8:48 ` Eryu Guan
  0 siblings, 1 reply; 2+ messages in thread
From: Sun Ke @ 2021-04-09 10:38 UTC (permalink / raw)
  To: fstests; +Cc: sunke32

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(-)

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] generic/591: tmpfs do not test with O_DIRECT flag
  2021-04-09 10:38 [PATCH] generic/591: tmpfs do not test with O_DIRECT flag Sun Ke
@ 2021-04-11  8:48 ` Eryu Guan
  0 siblings, 0 replies; 2+ messages in thread
From: Eryu Guan @ 2021-04-11  8:48 UTC (permalink / raw)
  To: Sun Ke; +Cc: fstests

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 10:38 [PATCH] generic/591: tmpfs do not test with O_DIRECT flag Sun Ke
2021-04-11  8:48 ` Eryu Guan

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git