public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Peng Haitao <penght@cn.fujitsu.com>
To: Dave Chinner <david@fromorbit.com>
Cc: hch@infradead.org, xfs@oss.sgi.com
Subject: Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
Date: Thu, 08 Dec 2011 10:25:38 +0800	[thread overview]
Message-ID: <4EE02022.5000403@cn.fujitsu.com> (raw)
In-Reply-To: <20111207100748.GB14273@dastard>


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

  reply	other threads:[~2011-12-08  2:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=4EE02022.5000403@cn.fujitsu.com \
    --to=penght@cn.fujitsu.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /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