xfs
[Top] [All Lists]

Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfstests/071 FAIL with pwrite64: Invalid argument
From: Peng Haitao <penght@xxxxxxxxxxxxxx>
Date: Thu, 08 Dec 2011 10:25:38 +0800
Cc: hch@xxxxxxxxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <20111207100748.GB14273@dastard>
References: <4EDD8F16.4050402@xxxxxxxxxxxxxx> <20111206110533.GD28326@dastard> <4EDF2133.7030702@xxxxxxxxxxxxxx> <20111207100748.GB14273@dastard>
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0
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@xxxxxxxxxxxxxx>
---
 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.


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