Skip to contentSkip to conversation

xfstests/071 FAIL with pwrite64: Invalid argument

PATCH Superseded Peng Haitao 3 participants 10 messages Dec 6, 2011 – Mar 31, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests/071 FAIL with pwrite64: Invalid argument

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

---
 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
071 +3 -0
index be9b11b..0693bd7 100755
@@ -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).
071.out deleted +0 -107

107 lines not on this page · raw message

071.out.irix new file +107 -0

107 lines not on this page · raw message

071.out.linux new file +117 -0

117 lines not on this page · raw message

Signature · 10 lines
1.7.1

-- 
Best Regards,
Peng Haitao

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 3 lines · Peng Haitao

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.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
Quoted 11 lines · Dave Chinner
Quoted 3 lines · Peng Haitao

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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
In reply to Dave Chinner

Hi,

Dave Chinner said the following on 2011-12-6 19:05:

Quoted 10 lines
Quoted 2 lines

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.

Signature · 7 lines
Best Regards,
Peng Haitao

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw
Quoted 24 lines · Peng Haitao

Hi,

Dave Chinner said the following on 2011-12-6 19:05:

Quoted 10 lines
Quoted 2 lines

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

Quoted 5 lines

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.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#5 lore raw

Dave Chinner said the following on 2011-12-7 18:07:

Quoted 6 lines

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

---
 071   |   16 +++++++++++++---
 group |    2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)
071 +13 -3
index be9b11b..7b6e402 100755
@@ -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
 }
group +1 -1
index 08d999a..b49c3b0 100644
@@ -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
Signature · 6 lines
1.7.1


-- 
Best Regards,
Peng
Quoted 14 lines

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....

Quoted 3 lines

Cheers,

Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw
Quoted 9 lines · Peng Haitao

Dave Chinner said the following on 2011-12-7 18:07:

Quoted 6 lines

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.

Quoted 4 lines

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.bad renamed from 071.out +2 -2
@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#7 lore raw

Christoph Hellwig said the following on 2012-1-5 0:53:

Quoted 2 lines

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?

Signature · 2 lines
Best Regards,
Peng
Quoted 12 lines
071.out.bad renamed from 071.out +2 -2
@@ -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>
 
Quoted 3 lines

and so on

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw

PATCH v2 1/1 xfstests/071 FAIL with pwrite64: Invalid argument

In reply to Christoph Hellwig

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

---
 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
071 +24 -6
index be9b11b..ace0ee4 100755
@@ -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
 
071.out.32 new file +107 -0

107 lines not on this page · raw message

071.out.64 new file +107 -0

107 lines not on this page · raw message

group +1 -1
index 01f406d..2015bee 100644
@@ -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
Signature · 6 lines
1.7.10.rc0

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs