xfs
[Top] [All Lists]

Re: Test 272 fails for ext3

To: Jan Kara <jack@xxxxxxx>
Subject: Re: Test 272 fails for ext3
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 17 Aug 2012 08:48:58 +1000
Cc: xfs@xxxxxxxxxxx, dmonakhov@xxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx
In-reply-to: <20120816093757.GA11519@xxxxxxxxxxxxx>
References: <20120816092808.GA9057@xxxxxxxxxxxxx> <20120816093757.GA11519@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Aug 16, 2012 at 11:37:57AM +0200, Jan Kara wrote:
>   Hello,
> 
>   I was looking into why test 272 from xfstests fails for ext3 and the
> reason is that ext3 does not support direct IO to file with enabled data
> journalling (open returns EINVAL because ->direct_IO callback is not
> specified). So I was thinking how to accomodate this fact in the test -
> the best I found was to just check using xfs_io whether O_DIRECT open
> succeeds and perform the test only in that case. Attached patch does this
> or do people have other ideas?


# ext3 doesn't support direct IO in journalling mode
ext3_write_opt_list="iflag=noatime conv=notrunc conv=fsync"
ext4_write_opt_list="iflag=noatime conv=notrunc conv=fsync oflag=direct"

if [ $FSTYP = "ext3" ]; then
        write_opt_list="$ext3_write_opt_list"
else
        write_opt_list="$ext4_write_opt_list"
fi

.....
> diff --git a/272 b/272
> index 26dfa3b..e39c52b 100755
> --- a/272
> +++ b/272
> @@ -52,6 +52,12 @@ _workout()
>                   
>                       echo "OP write_opt: $write_opt 4M, \
>  chattr_opt: $chattr_opt"
> +                     if [ "$write_opt" = "oflag=direct" ]; then
> +                             # Some filesystems don't support direct IO
> +                             # in some cases, check for that
> +                             xfs_io -F -d -f -c "" $SCRATCH_MNT/file.$idx \
> +                                     >> $seq.full 2>&1 || continue
> +                     fi

That only fixes one of the two places that does direct IO on a
jounralled file. The above will fix both...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>