FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Dushan Tcholich <dusanc@gmail.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] Check O_DIRECT support before testing direct I/O
Date: Tue, 16 Dec 2014 13:00:34 +1100	[thread overview]
Message-ID: <20141216020034.GD2152@dastard> (raw)
In-Reply-To: <alpine.LNX.2.00.1412152332120.21847@reiser4.gekom>

On Tue, Dec 16, 2014 at 12:03:35AM +0100, Dushan Tcholich wrote:
> 
> In december 2013 Juhno Ryu posted a patch xfstests: check O_DIRECT 
> support before testing direct I/O to xfs@oss.sgi.com 
> http://oss.sgi.com/archives/xfs/2013-12/msg00759.html
> 
> As there are no archives of fstests m-l I couldn't find why his 
> patches weren't applied so apologise if this is innapropriate but  
> I rebased his patch upon current xfstests code:
> 
> ---
> 
> Some filesystems do not support O_DIRECT.  Check whether TEST_DIR supports 
> it by running xfs_io with and without -d flag.
> 
> Signed-off-by: Junho Ryu <jayr@google.com>
> Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
> 
> ---
> 
> 
> --- xfstests.orig/common/rc	2014-12-14 15:17:59.000000000 +0100
> +++ xfstests/common/rc	2014-12-15 19:40:36.000000000 +0100
> @@ -1391,6 +1395,7 @@
>          AIO_TEST=src/aio-dio-regress/$1
>          [ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
>      fi
> +    _require_odirect
>  }
>  
>  # run an aio-dio program
> @@ -1519,6 +1524,20 @@
>  		_notrun "xfs_io $command failed (old kernel/wrong fs?)"
>  }
>  
> +# check that kernel and filesystem support direct I/O
> +_require_odirect()
> +{
> +       testfile=$TEST_DIR/$$.direct
> +       $XFS_IO_PROG -F -f -c "pwrite 0 20k" $testfile 2>&1
> +       if [ $? -eq 0 ]; then
> +               $XFS_IO_PROG -F -f -d -c "pwrite 0 20k" $testfile 2>&1
> +               if [ $? -ne 0 ]; then
> +                       _notrun "O_DIRECT is not supported"
> +               fi
> +       fi
> +       rm -f $testfile 2>&1 > /dev/null
> +}

FWIW, I'd appreciate it if people tested their patches to ensure
they don't cause test failures before posting them. This causes
every test that _requires_odirect to fail because the xfs_io output
is not directed to /dev/null:

generic/036 11s ... - output mismatch (see /home/dave/src/xfstests-dev/results//generic/036.out.bad)
    --- tests/generic/036.out   2014-11-13 16:14:32.000000000 +1100
    +++ /home/dave/src/xfstests-dev/results//generic/036.out.bad        2014-12-16 12:46:53.000000000 +1100
    @@ -1,2 +1,4 @@
     QA output created by 036
    +wrote 20480/20480 bytes at offset 0
    +20 KiB, 5 ops; 0.0000 sec (3.896 MiB/sec and 997.4067 ops/sec)
     All tasks are spawned
    ...
    (Run 'diff -u tests/generic/036.out /home/dave/src/xfstests-dev/results//generic/036.out.bad'  to see the entire diff)

I've fixed this in v2 of the patch....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2014-12-16  2:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 23:03 [PATCH] Check O_DIRECT support before testing direct I/O Dushan Tcholich
2014-12-15 21:32 ` Dave Chinner
2014-12-15 21:52   ` Theodore Ts'o
2014-12-16  2:00 ` Dave Chinner [this message]
2014-12-16  6:32   ` Dušan Čolić

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141216020034.GD2152@dastard \
    --to=david@fromorbit.com \
    --cc=dusanc@gmail.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox