All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
@ 2011-12-06  3:42 Peng Haitao
  2011-12-06 11:05 ` Dave Chinner
  0 siblings, 1 reply; 10+ messages in thread
From: Peng Haitao @ 2011-12-06  3:42 UTC (permalink / raw)
  To: hch; +Cc: linux-xfs


When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
the error message should be "Invalid argument".

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 071           |    3 +
 071.out       |  107 ----------------------------------------------------
 071.out.irix  |  107 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 071.out.linux |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 227 insertions(+), 107 deletions(-)
 delete mode 100644 071.out
 create mode 100644 071.out.irix
 create mode 100644 071.out.linux

diff --git a/071 b/071
index be9b11b..0693bd7 100755
--- a/071
+++ b/071
@@ -91,6 +91,9 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 echo
 _scratch_mount
 
+# link correct .out file
+_link_out_file $seq.out
+
 # Okay... filesize limit depends on blocksize, bits per long and
 # also if large block device patch is enabled (can't dynamically
 # check that, so use env var USE_LBD_PATCH to override default).
diff --git a/071.out b/071.out
deleted file mode 100644
index 2ea0ef0..0000000
--- a/071.out
+++ /dev/null
@@ -1,107 +0,0 @@
-QA output created by 071
-meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
-data     = bsize=XXX blocks=XXX, imaxpct=PCT
-         = sunit=XXX swidth=XXX, unwritten=X
-naming   =VERN bsize=XXX
-log      =LDEV bsize=XXX blocks=XXX
-realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
-
-Writing 512 bytes, offset is +0 (direct=false)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 512 bytes (direct=false)
-read 512/512 bytes at offset <OFFSET>
-
-Writing 512 bytes, offset is minus 1 byte (direct=false)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 512 bytes (direct=false)
-read 512/512 bytes at offset <OFFSET>
-
-Writing 512 bytes, offset is minus 1FSB (direct=false)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 512 bytes (direct=false)
-read 512/512 bytes at offset <OFFSET>
-
-Writing 1 bytes, offset is minus 1FSB (direct=false)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 1 bytes (direct=false)
-read 1/1 bytes at offset <OFFSET>
-
-Writing 1FSB bytes, offset is +0 (direct=true)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 1FSB bytes (direct=true)
-read 512/1FSB bytes at offset <OFFSET>
-
-Writing 1FSB bytes, offset is minus 1FSB (direct=true)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 1FSB bytes (direct=true)
-read 513/1FSB bytes at offset <OFFSET>
-
-=== Iterating, 2 remains
-
-
-Writing 512 bytes, offset is +0 (direct=false)
-pwrite64: File too large
-Reading 512 bytes (direct=false)
-read 0/512 bytes at offset <OFFSET>
-
-Writing 512 bytes, offset is minus 1 byte (direct=false)
-pwrite64: File too large
-Reading 512 bytes (direct=false)
-read 0/512 bytes at offset <OFFSET>
-
-Writing 512 bytes, offset is minus 1FSB (direct=false)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 512 bytes (direct=false)
-read 512/512 bytes at offset <OFFSET>
-
-Writing 1 bytes, offset is minus 1FSB (direct=false)
-wrote 512/512 bytes at offset <OFFSET>
-Reading 1 bytes (direct=false)
-read 1/1 bytes at offset <OFFSET>
-
-Writing 1FSB bytes, offset is +0 (direct=true)
-pwrite64: File too large
-Reading 1FSB bytes (direct=true)
-read 0/1FSB bytes at offset <OFFSET>
-
-Writing 1FSB bytes, offset is minus 1FSB (direct=true)
-pwrite64: File too large
-Reading 1FSB bytes (direct=true)
-read 0/1FSB bytes at offset <OFFSET>
-
-=== Iterating, 1 remains
-
-
-Writing 512 bytes, offset is +0 (direct=false)
-pwrite64: File too large
-Reading 512 bytes (direct=false)
-read 0/512 bytes at offset <OFFSET>
-
-Writing 512 bytes, offset is minus 1 byte (direct=false)
-pwrite64: File too large
-Reading 512 bytes (direct=false)
-read 0/512 bytes at offset <OFFSET>
-
-Writing 512 bytes, offset is minus 1FSB (direct=false)
-pwrite64: File too large
-Reading 512 bytes (direct=false)
-read 0/512 bytes at offset <OFFSET>
-
-Writing 1 bytes, offset is minus 1FSB (direct=false)
-pwrite64: File too large
-Reading 1 bytes (direct=false)
-read 0/1 bytes at offset <OFFSET>
-
-Writing 1FSB bytes, offset is +0 (direct=true)
-pwrite64: File too large
-Reading 1FSB bytes (direct=true)
-read 0/1FSB bytes at offset <OFFSET>
-
-Writing 1FSB bytes, offset is minus 1FSB (direct=true)
-pwrite64: File too large
-Reading 1FSB bytes (direct=true)
-read 0/1FSB bytes at offset <OFFSET>
-
-=== Iterating, 0 remains
-
-
diff --git a/071.out.irix b/071.out.irix
new file mode 100644
index 0000000..2ea0ef0
--- /dev/null
+++ b/071.out.irix
@@ -0,0 +1,107 @@
+QA output created by 071
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+
+Writing 512 bytes, offset is +0 (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 512/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 513/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 2 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 1 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+pwrite64: File too large
+Reading 1 bytes (direct=false)
+read 0/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 0 remains
+
+
diff --git a/071.out.linux b/071.out.linux
new file mode 100644
index 0000000..56a7b47
--- /dev/null
+++ b/071.out.linux
@@ -0,0 +1,117 @@
+QA output created by 071
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+
+Writing 512 bytes, offset is +0 (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 512/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 513/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 2 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+pwrite64: Invalid argument
+Reading 512 bytes (direct=false)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+pwrite64: Invalid argument
+Reading 512 bytes (direct=false)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+pwrite64: Invalid argument
+Reading 1FSB bytes (direct=true)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+pwrite64: Invalid argument
+Reading 1FSB bytes (direct=true)
+pread64: Invalid argument
+pread64: Invalid argument
+
+=== Iterating, 1 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+pwrite64: Invalid argument
+Reading 512 bytes (direct=false)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+pwrite64: Invalid argument
+Reading 512 bytes (direct=false)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+pwrite64: Invalid argument
+Reading 512 bytes (direct=false)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+pwrite64: Invalid argument
+Reading 1 bytes (direct=false)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+pwrite64: Invalid argument
+Reading 1FSB bytes (direct=true)
+pread64: Invalid argument
+pread64: Invalid argument
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+pwrite64: Invalid argument
+Reading 1FSB bytes (direct=true)
+pread64: Invalid argument
+pread64: Invalid argument
+
+=== Iterating, 0 remains
+
+
-- 
1.7.1

-- 
Best Regards,
Peng Haitao

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2011-12-06  3:42 [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument Peng Haitao
@ 2011-12-06 11:05 ` Dave Chinner
  2011-12-06 11:23   ` Christoph Hellwig
  2011-12-07  8:17   ` Peng Haitao
  0 siblings, 2 replies; 10+ messages in thread
From: Dave Chinner @ 2011-12-06 11:05 UTC (permalink / raw)
  To: Peng Haitao; +Cc: hch, linux-xfs

On Tue, Dec 06, 2011 at 11:42:14AM +0800, Peng Haitao wrote:
> 
> When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
> the error message should be "Invalid argument".

Fixing this just requires an additional filter. The write outpu is
already passed through 2 filters to remove ariable numbers from the
output, so one more to standardise the error isn't a problem.

Further, filtering of the error stream on the reads to only appear
in $seq.full solves the extra error output on reads as well.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2011-12-06 11:05 ` Dave Chinner
@ 2011-12-06 11:23   ` Christoph Hellwig
  2011-12-07  8:17   ` Peng Haitao
  1 sibling, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2011-12-06 11:23 UTC (permalink / raw)
  To: Dave Chinner; +Cc: hch, linux-xfs, Peng Haitao

On Tue, Dec 06, 2011 at 10:05:33PM +1100, Dave Chinner wrote:
> On Tue, Dec 06, 2011 at 11:42:14AM +0800, Peng Haitao wrote:
> > 
> > When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
> > the error message should be "Invalid argument".
> 
> Fixing this just requires an additional filter. The write outpu is
> already passed through 2 filters to remove ariable numbers from the
> output, so one more to standardise the error isn't a problem.
> 
> Further, filtering of the error stream on the reads to only appear
> in $seq.full solves the extra error output on reads as well.

Yes, I was about to say the same.  Also now that it passes please add
the test to the "auto" group.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2011-12-06 11:05 ` Dave Chinner
  2011-12-06 11:23   ` Christoph Hellwig
@ 2011-12-07  8:17   ` Peng Haitao
  2011-12-07 10:07     ` Dave Chinner
  1 sibling, 1 reply; 10+ messages in thread
From: Peng Haitao @ 2011-12-07  8:17 UTC (permalink / raw)
  To: david; +Cc: hch, xfs

Hi, 

Dave Chinner said the following on 2011-12-6 19:05:
>> When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
>> the error message should be "Invalid argument".
> 
> Fixing this just requires an additional filter. The write outpu is
> already passed through 2 filters to remove ariable numbers from the
> output, so one more to standardise the error isn't a problem.
> 
> Further, filtering of the error stream on the reads to only appear
> in $seq.full solves the extra error output on reads as well.
> 

Thanks for your comments.

When offset + length is overflow, the case expect:
  - pwrite output error messages: pwrite64: File too large
  - pread output right message:   read 0/512 bytes at offset <OFFSET>

but in linux, the actual results:
  - pwrite output error messages: pwrite64: Invalid argument
  - pread output right message:   pread64: Invalid argument

I can add an additional filter to remove variable messages, 
but if I remove variable messages, the 071.out will remain echo content:
Writing 512 bytes, offset is +0 (direct=false)
Reading 512 bytes (direct=false)
...

This will make the case meaningless.

-- 
Best Regards,
Peng Haitao

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2011-12-07  8:17   ` Peng Haitao
@ 2011-12-07 10:07     ` Dave Chinner
  2011-12-08  2:25       ` Peng Haitao
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Chinner @ 2011-12-07 10:07 UTC (permalink / raw)
  To: Peng Haitao; +Cc: hch, xfs

On Wed, Dec 07, 2011 at 04:17:55PM +0800, Peng Haitao wrote:
> Hi, 
> 
> Dave Chinner said the following on 2011-12-6 19:05:
> >> When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
> >> the error message should be "Invalid argument".
> > 
> > Fixing this just requires an additional filter. The write outpu is
> > already passed through 2 filters to remove ariable numbers from the
> > output, so one more to standardise the error isn't a problem.
> > 
> > Further, filtering of the error stream on the reads to only appear
> > in $seq.full solves the extra error output on reads as well.
> > 
> 
> Thanks for your comments.
> 
> When offset + length is overflow, the case expect:
>   - pwrite output error messages: pwrite64: File too large
>   - pread output right message:   read 0/512 bytes at offset <OFFSET>
> 
> but in linux, the actual results:
>   - pwrite output error messages: pwrite64: Invalid argument
>   - pread output right message:   pread64: Invalid argument
> 
> I can add an additional filter to remove variable messages, 
> but if I remove variable messages, the 071.out will remain echo content:
> Writing 512 bytes, offset is +0 (direct=false)
> Reading 512 bytes (direct=false)
> ...

I think you misunderstand what I was saying - I was not suggesting
removing the error messages at all, just filtering them with sed to
ensure the output is always constant for the error different
messages different platforms dump out.

Have a look at the patch I sent earlier today for test 103 ([PATCH
2/2] xfstests: ln failure output has changed again) as an example of
error message filtering for multi-platform (Irix and Linux are
different) and multiple-version (coreutils v < 6 output is different
to 6 <= v < 8 and the current 8.x is different again) support with a
single golden image.

That is, the output in the golden image does not change, instead we
use a filter to convert the known different error messages to match
the error in the golden image. If the error message is different to
what the filter catches or does not appear, then the test still
fails as desired. Essentially the output filter encodes all the
variants of the valid error messages for the given test....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2011-12-07 10:07     ` Dave Chinner
@ 2011-12-08  2:25       ` Peng Haitao
  2012-01-04 16:53         ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Peng Haitao @ 2011-12-08  2:25 UTC (permalink / raw)
  To: Dave Chinner; +Cc: hch, xfs


Dave Chinner said the following on 2011-12-7 18:07:
> 
> I think you misunderstand what I was saying - I was not suggesting
> removing the error messages at all, just filtering them with sed to
> ensure the output is always constant for the error different
> messages different platforms dump out.
> 

Thanks for your reply.
Sorry for misunderstanding your comments.

I make a new patch, please review, thanks.

When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
the error message should be "Invalid argument".

The patch fix as following:
  - "pwrite64: Invalid argument" will be replaced with "pwrite64: File too large"
  - "pread64: Invalid argument" will be replaced with "read 0/xxx bytes at offset <OFFSET>"
  - delete _filter_xfs_io
  - add auto group

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 071   |   16 +++++++++++++---
 group |    2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/071 b/071
index be9b11b..7b6e402 100755
--- a/071
+++ b/071
@@ -53,6 +53,16 @@ _filter_off()
     sed -e "s/$1/<OFFSET>/g" | _filter_io
 }
 
+_filter_pwrite()
+{
+    sed -e "s/pwrite64: Invalid argument/pwrite64: File too large/g"
+}
+
+_filter_pread()
+{
+    sed -e "s/pread64: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io
+}
+
 write_block()
 {
     location=$1
@@ -66,15 +76,15 @@ write_block()
     echo "Writing $bytes bytes, offset is $words (direct=$direct)" | _filter_io
     echo "Writing $bytes bytes at $location $words (direct=$direct)" >>$seq.full
     $XFS_IO_PROG -c "pwrite $offset 512" $flags $SCRATCH_MNT/$seq \
-	2>&1 | _filter_off $offset | _filter_xfs_io | tee -a $seq.full
+	2>&1 | _filter_off $offset | tee -a $seq.full | _filter_pwrite
     xfs_bmap -v $SCRATCH_MNT/$seq >>$seq.full
 
     echo "Reading $bytes bytes (direct=$direct)" | _filter_io
     echo "Reading $bytes bytes at $location (direct=$direct)" >>$seq.full
     $XFS_IO_PROG -c "pread $offset $bytes" $flags $SCRATCH_MNT/$seq \
-	2>&1 | _filter_off $offset | _filter_xfs_io | tee -a $seq.full
+	2>&1 | _filter_off $offset | tee -a $seq.full | _filter_pread
 
-    $XFS_IO_PROG -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full
+    $XFS_IO_PROG -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full 2>&1
 
     echo | tee -a $seq.full
 }
diff --git a/group b/group
index 08d999a..b49c3b0 100644
--- a/group
+++ b/group
@@ -181,7 +181,7 @@ deprecated
 068 other auto
 069 rw udf auto quick
 070 attr udf auto quick
-071 rw
+071 rw auto
 072 rw auto prealloc quick
 073 copy auto
 074 rw udf auto
-- 
1.7.1


-- 
Best Regards,
Peng

> Have a look at the patch I sent earlier today for test 103 ([PATCH
> 2/2] xfstests: ln failure output has changed again) as an example of
> error message filtering for multi-platform (Irix and Linux are
> different) and multiple-version (coreutils v < 6 output is different
> to 6 <= v < 8 and the current 8.x is different again) support with a
> single golden image.
> 
> That is, the output in the golden image does not change, instead we
> use a filter to convert the known different error messages to match
> the error in the golden image. If the error message is different to
> what the filter catches or does not appear, then the test still
> fails as desired. Essentially the output filter encodes all the
> variants of the valid error messages for the given test....
> 
> Cheers,
> 
> Dave.


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2011-12-08  2:25       ` Peng Haitao
@ 2012-01-04 16:53         ` Christoph Hellwig
  2012-01-06  3:53           ` Peng Haitao
  2012-03-15  2:25           ` [PATCH v2] " Peng Haitao
  0 siblings, 2 replies; 10+ messages in thread
From: Christoph Hellwig @ 2012-01-04 16:53 UTC (permalink / raw)
  To: Peng Haitao; +Cc: hch, xfs

On Thu, Dec 08, 2011 at 10:25:38AM +0800, Peng Haitao wrote:
> 
> Dave Chinner said the following on 2011-12-7 18:07:
> > 
> > I think you misunderstand what I was saying - I was not suggesting
> > removing the error messages at all, just filtering them with sed to
> > ensure the output is always constant for the error different
> > messages different platforms dump out.
> > 
> 
> Thanks for your reply.
> Sorry for misunderstanding your comments.
> 
> I make a new patch, please review, thanks.

This still fails in my 32-bit test VM:

--- 071.out	2009-05-10 16:48:46.000000000 +0000
+++ 071.out.bad	2012-01-04 16:47:05.000000000 +0000
@@ -40,14 +40,14 @@
 
  
 Writing 512 bytes, offset is +0 (direct=false)
-pwrite64: File too large
+wrote 512/512 bytes at offset <OFFSET>
 Reading 512 bytes (direct=false)
-read 0/512 bytes at offset <OFFSET>
+read 512/512 bytes at offset <OFFSET>

and so on

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
  2012-01-04 16:53         ` Christoph Hellwig
@ 2012-01-06  3:53           ` Peng Haitao
  2012-03-15  2:25           ` [PATCH v2] " Peng Haitao
  1 sibling, 0 replies; 10+ messages in thread
From: Peng Haitao @ 2012-01-06  3:53 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs


Christoph Hellwig said the following on 2012-1-5 0:53:
> This still fails in my 32-bit test VM:
> 

yeah:(

This case will exercise IO at large file with as following condition:
  - below upperbound
  - upperbound
  - above upperbound
But in 32-bit, the case cannot satisfy the condition unless upperbound=16.
When upperbound=16, the case will hung.

The following steps will hung.
# uname -a
Linux Fedora-16-x86 3.1.0-7.fc16.i686.PAE #1 SMP Tue Nov 1 20:53:45 UTC 2011 i686 i686 i386 GNU/Linux
# rpm -q xfsprogs
xfsprogs-3.1.5-1.fc16.i686
# mount /dev/sda10 /sda10/
# xfs_info /dev/sda10
meta-data=/dev/sda10             isize=256    agcount=4, agsize=305088 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=1220352, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
# cd /sda10/
# xfs_io -f -c "pwrite 17592186040320 512" tmp
wrote 512/512 bytes at offset 17592186040320
512.000000 bytes, 1 ops; 0.0000 sec (12.850 MiB/sec and 26315.7895 ops/sec)
# xfs_bmap -v tmp

This will hung:( 
What is wrong with the steps or xfs wrong?

-- 
Best Regards,
Peng

> --- 071.out	2009-05-10 16:48:46.000000000 +0000
> +++ 071.out.bad	2012-01-04 16:47:05.000000000 +0000
> @@ -40,14 +40,14 @@
>  
>   
>  Writing 512 bytes, offset is +0 (direct=false)
> -pwrite64: File too large
> +wrote 512/512 bytes at offset <OFFSET>
>  Reading 512 bytes (direct=false)
> -read 0/512 bytes at offset <OFFSET>
> +read 512/512 bytes at offset <OFFSET>
> 
> and so on
> 
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* [PATCH v2] xfstests/071 FAIL with pwrite64: Invalid argument
  2012-01-04 16:53         ` Christoph Hellwig
  2012-01-06  3:53           ` Peng Haitao
@ 2012-03-15  2:25           ` Peng Haitao
  2012-03-31 20:13             ` [PATCH v2] 071: make this test work as expected on Linux Christoph Hellwig
  1 sibling, 1 reply; 10+ messages in thread
From: Peng Haitao @ 2012-03-15  2:25 UTC (permalink / raw)
  To: hch, david; +Cc: xfs

When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
the error message should be "Invalid argument".

In 32_bit, offset + length should cause pread and pwrite to error, So the
out should be OK.

The patch fix as following:
  - "pwrite64: Invalid argument" will be replaced with "pwrite64: File too large"
  - "pread64: Invalid argument" will be replaced with "read 0/xxx bytes at offset <OFFSET>"
  - delete _filter_xfs_io
  - add auto group
  - add 071.out.32

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 071        |   30 +++++++++++++----
 071.out.32 |  107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 071.out.64 |  107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 group      |    2 +-
 4 files changed, 239 insertions(+), 7 deletions(-)
 create mode 100644 071.out.32
 create mode 100644 071.out.64

diff --git a/071 b/071
index be9b11b..ace0ee4 100755
--- a/071
+++ b/071
@@ -43,6 +43,15 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./common.rc
 . ./common.filter
 
+bitsperlong=`src/feature -w`
+# link correct .out file
+rm -f $seq.out
+if [ "$bitsperlong" -eq 32 ]; then
+	ln -s $seq.out.32 $seq.out
+else
+	ln -s $seq.out.64 $seq.out
+fi
+
 _filter_io()
 {
     sed -e "s/$dbsize/1FSB/g" -e '/.* ops; /d'
@@ -53,6 +62,16 @@ _filter_off()
     sed -e "s/$1/<OFFSET>/g" | _filter_io
 }
 
+_filter_pwrite()
+{
+	sed -e "s/pwrite64: Invalid argument/pwrite64: File too large/g"
+}
+
+_filter_pread()
+{
+	sed -e "s/pread64: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io
+}
+
 write_block()
 {
     location=$1
@@ -66,15 +85,15 @@ write_block()
     echo "Writing $bytes bytes, offset is $words (direct=$direct)" | _filter_io
     echo "Writing $bytes bytes at $location $words (direct=$direct)" >>$seq.full
     $XFS_IO_PROG -c "pwrite $offset 512" $flags $SCRATCH_MNT/$seq \
-	2>&1 | _filter_off $offset | _filter_xfs_io | tee -a $seq.full
+	2>&1 | _filter_off $offset | tee -a $seq.full | _filter_pwrite
     xfs_bmap -v $SCRATCH_MNT/$seq >>$seq.full
 
     echo "Reading $bytes bytes (direct=$direct)" | _filter_io
     echo "Reading $bytes bytes at $location (direct=$direct)" >>$seq.full
     $XFS_IO_PROG -c "pread $offset $bytes" $flags $SCRATCH_MNT/$seq \
-	2>&1 | _filter_off $offset | _filter_xfs_io | tee -a $seq.full
+	2>&1 | _filter_off $offset | tee -a $seq.full | _filter_pread
 
-    $XFS_IO_PROG -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full
+    $XFS_IO_PROG -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full 2>&1
 
     echo | tee -a $seq.full
 }
@@ -94,7 +113,7 @@ _scratch_mount
 # Okay... filesize limit depends on blocksize, bits per long and
 # also if large block device patch is enabled (can't dynamically
 # check that, so use env var USE_LBD_PATCH to override default).
-# 
+#
 # Note:
 # We check from 1Tb below our guessed limit to 1Tb above it, and
 # see what happens for each 1Tb increment along the way (first
@@ -102,14 +121,13 @@ _scratch_mount
 # So, number calculated here is not the actual limit, its a ways
 # above that, hopefully.
 
-bitsperlong=`src/feature -w`
 if [ "$bitsperlong" -eq 32 ]; then
     upperbound=`expr $dbsize / 512`
     # which is 8(TB) for 4K, 4(TB) for 2k, ... etc.
     [ "$USE_LBD_PATCH" = yes ] && upperbound=16
     # limited by page cache index when LBD patch onboard.
 else
-    upperbound=`echo 8 \* 1024 \* 1024 | bc` 
+    upperbound=`echo 8 \* 1024 \* 1024 | bc`
     # 8 exabytes (working in TBs below)
 fi
 
diff --git a/071.out.32 b/071.out.32
new file mode 100644
index 0000000..48b8575
--- /dev/null
+++ b/071.out.32
@@ -0,0 +1,107 @@
+QA output created by 071
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+
+Writing 512 bytes, offset is +0 (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 512/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 513/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 2 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 512/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 513/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 1 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 512/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 513/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 0 remains
+
+
diff --git a/071.out.64 b/071.out.64
new file mode 100644
index 0000000..2ea0ef0
--- /dev/null
+++ b/071.out.64
@@ -0,0 +1,107 @@
+QA output created by 071
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+
+Writing 512 bytes, offset is +0 (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 512/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1FSB bytes (direct=true)
+read 513/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 2 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 512 bytes (direct=false)
+read 512/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+wrote 512/512 bytes at offset <OFFSET>
+Reading 1 bytes (direct=false)
+read 1/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 1 remains
+
+
+Writing 512 bytes, offset is +0 (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1 byte (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 512 bytes, offset is minus 1FSB (direct=false)
+pwrite64: File too large
+Reading 512 bytes (direct=false)
+read 0/512 bytes at offset <OFFSET>
+
+Writing 1 bytes, offset is minus 1FSB (direct=false)
+pwrite64: File too large
+Reading 1 bytes (direct=false)
+read 0/1 bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is +0 (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+Writing 1FSB bytes, offset is minus 1FSB (direct=true)
+pwrite64: File too large
+Reading 1FSB bytes (direct=true)
+read 0/1FSB bytes at offset <OFFSET>
+
+=== Iterating, 0 remains
+
+
diff --git a/group b/group
index 01f406d..2015bee 100644
--- a/group
+++ b/group
@@ -181,7 +181,7 @@ deprecated
 068 other auto
 069 rw udf auto quick
 070 attr udf auto quick
-071 rw
+071 rw auto
 072 rw auto prealloc quick
 073 copy auto
 074 rw udf auto
-- 
1.7.10.rc0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH v2] 071: make this test work as expected on Linux
  2012-03-15  2:25           ` [PATCH v2] " Peng Haitao
@ 2012-03-31 20:13             ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2012-03-31 20:13 UTC (permalink / raw)
  To: Peng Haitao; +Cc: hch, xfs

Thanks, applied.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2012-03-31 20:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06  3:42 [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument Peng Haitao
2011-12-06 11:05 ` Dave Chinner
2011-12-06 11:23   ` Christoph Hellwig
2011-12-07  8:17   ` Peng Haitao
2011-12-07 10:07     ` Dave Chinner
2011-12-08  2:25       ` Peng Haitao
2012-01-04 16:53         ` Christoph Hellwig
2012-01-06  3:53           ` Peng Haitao
2012-03-15  2:25           ` [PATCH v2] " Peng Haitao
2012-03-31 20:13             ` [PATCH v2] 071: make this test work as expected on Linux Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.