filter: xfs_io output has dropped "64" from error messages
PATCH 1/1 filter: xfs_io output has dropped "64" from error messages
From: Dave Chinner <[email protected]>
Upstream xfs_io has been converted to always use LFS compliant (i.e. 64 bit) pwrite() rather than pwrite64(). Similar changes have been made for multiple syscalls that have "*64" variants. hence the error output of all these commands has changed, such as "pwrite64:
..." to "pwrite: ....".
Make a filter to catch the *64 variants and strip it, and convert all the golden output to use the non-*64 variant. This will make all golden output matching work correctly regardless of what version of xfs_io is in use.
--- common/filter | 7 +++++++ tests/btrfs/126 | 4 ++-- tests/btrfs/126.out | 2 +- tests/ext4/306 | 3 ++- tests/ext4/306.out | 2 +- tests/f2fs/001 | 6 ++---- tests/f2fs/001.out | 2 +- tests/generic/171 | 6 ++++-- tests/generic/171.out | 4 ++-- tests/generic/172 | 6 ++++-- tests/generic/172.out | 4 ++-- tests/generic/174 | 6 ++++-- tests/generic/174.out | 4 ++-- tests/generic/230 | 12 ++++++++---- tests/generic/230.out | 8 ++++---- tests/generic/271 | 3 ++- tests/generic/271.out | 2 +- tests/generic/272 | 3 ++- tests/generic/272.out | 2 +- tests/generic/276 | 3 ++- tests/generic/276.out | 2 +- tests/generic/278 | 3 ++- tests/generic/278.out | 2 +- tests/generic/328 | 6 ++++-- tests/generic/328.out | 4 ++-- tests/xfs/071 | 4 ++-- tests/xfs/071.out.64 | 20 ++++++++++---------- tests/xfs/182 | 6 ++++-- tests/xfs/182.out | 2 +- 29 files changed, 81 insertions(+), 57 deletions(-)
common/filter +7 -0
@@ -226,6 +226,13 @@ _filter_xfs_io() sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infa0-9/.]* [EPGMKiBbytes]*\/sec and [infa0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/" } +# stderr filter for xfs_io to handle change of error output format (e.g. +# pwrite64 -> pwrite). +_filter_xfs_io_error() +{ + sed -e "s/^\(.*\)64\(: .*$\)/\1\2/" +} + _filter_xfs_io_unique() { common_line_filter | _filter_xfs_io
tests/btrfs/126 +2 -2
@@ -62,8 +62,8 @@ _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # so redirect stdout to seqres.full. # Also, EDQUOTA is expected, which can't be redirected due to the limitation # of _filter_xfs_io, so golden output will include EDQUOTA error message -_pwrite_byte 0xcdcdcdcd 0 1M $SCRATCH_MNT/test_file | _filter_xfs_io \ - >> $seqres.full +_pwrite_byte 0xcdcdcdcd 0 1M $SCRATCH_MNT/test_file 2>&1 >> $seqres.full | \ + _filter_xfs_io_error # Fstests will umount the fs, and at umount time, kernel warning will be # triggered
tests/btrfs/126.out +1 -1
@@ -1,2 +1,2 @@ QA output created by 126 -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded
tests/ext4/306 +2 -1
@@ -57,7 +57,8 @@ $XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io # Create a large non-extent-based file filling the fs; this will run out & fail echo "Create testfile2 to fill the fs" -$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io +$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" 2>&1 | \ + _filter_xfs_io_error df -h $SCRATCH_MNT >> $seqres.full # Grow fs by 512m
tests/ext4/306.out +1 -1
@@ -3,7 +3,7 @@ Create 1m testfile1 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Create testfile2 to fill the fs -pwrite64: No space left on device +pwrite: No space left on device Resize to 1g append 2m to testfile1 wrote 2097152/2097152 bytes at offset 1048576
tests/f2fs/001 +2 -4
@@ -69,10 +69,8 @@ $XFS_IO_PROG -t -f -c "falloc 0 5g" $dummyfile | _filter_xfs_io # -ENOSPC should be triggered without any panic echo "==== change i_size & write data ====" -$XFS_IO_PROG \ - -c "truncate 96" \ - -c "pwrite -S 0x58 8192 4096" \ -$testfile | _filter_xfs_io +$XFS_IO_PROG -c "truncate 96" -c "pwrite -S 0x58 8192 4096" $testfile \ + | _filter_xfs_io_error echo "==== check data contents ====" hexdump -C $testfile
tests/f2fs/001.out +1 -1
@@ -5,7 +5,7 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ==== Fullfill the partition ==== fallocate: No space left on device ==== change i_size & write data ==== -pwrite64: No space left on device +pwrite: No space left on device ==== check data contents ==== 00000000 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 |XXXXXXXXXXXXXXXX| *
tests/generic/171 +4 -2
@@ -81,7 +81,8 @@ _pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
@@ -89,7 +90,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
tests/generic/171.out +2 -2
@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on device
tests/generic/172 +4 -2
@@ -77,7 +77,8 @@ _pwrite_byte 0x61 0 $fs_size $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
@@ -85,7 +86,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
tests/generic/172.out +2 -2
@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on device
tests/generic/174 +4 -2
@@ -82,7 +82,8 @@ _pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
@@ -90,7 +91,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
tests/generic/174.out +2 -2
@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on device
tests/generic/230 +8 -4
@@ -62,23 +62,27 @@ test_enforcement() # Firstly fit below block soft limit echo "Write 900k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 900k' -c fsync \ - $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Secondly overcome block soft limit echo "Rewrite 1001k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1001k' -c fsync \ - $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Now try to overcome block hardlimit echo "Write 1000k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1000k' -c fsync \ - $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Now sleep for grace time and check that softlimit got enforced sleep $((grace+1)) echo "Write 4096..." su $qa_user -c "$XFS_IO_PROG -c 'truncate 0' -c 'pwrite 0 4096' \ - $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # And now the softlimit test for inodes # First reset space limits so that we don't have problems with
tests/generic/230.out +4 -4
@@ -7,9 +7,9 @@ QA output created by 230 Write 900k... Rewrite 1001k... Write 1000k... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Write 4096... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Touch 3+4 Touch 5+6 touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
@@ -23,9 +23,9 @@ touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded Write 900k... Rewrite 1001k... Write 1000k... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Write 4096... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Touch 3+4 Touch 5+6 touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
tests/generic/271 +2 -1
@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/271.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 Check for damage
tests/generic/272 +2 -1
@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error echo "Clean up the mess" _dmerror_unmount
tests/generic/272.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Clean up the mess Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1
tests/generic/276 +2 -1
@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table rm -rf $testdir/file2 >> $seqres.full 2>&1 _dmerror_unmount
tests/generic/276.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 Check for damage
tests/generic/278 +2 -1
@@ -82,7 +82,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table echo "Rewrite"
tests/generic/278.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Rewrite Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1
tests/generic/328 +4 -2
@@ -79,11 +79,13 @@ setquota -u fsgqa 0 1024 0 0 $SCRATCH_MNT _repquota echo "Try to dio write the whole file" -_pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full +_pwrite_byte 0x62 0 $sz $testdir/file1 -d 2>&1 >> $seqres.full | \ + _filter_xfs_io_error _repquota echo "Try to write the whole file" -_pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $sz $testdir/file1 2>&1 >> $seqres.full | \ + _filter_xfs_io_error _repquota echo "Set hard quota to allow rewrite"
tests/generic/328.out +2 -2
@@ -7,11 +7,11 @@ Set hard quota to prevent rewrite root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Try to dio write the whole file -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Try to write the whole file -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Set hard quota to allow rewrite
tests/xfs/071 +2 -2
@@ -64,12 +64,12 @@ _filter_off() _filter_pwrite() { - sed -e "s/pwrite64: Invalid argument/pwrite64: File too large/g" + sed -e "s/pwrite.*: Invalid argument/pwrite: File too large/g" } _filter_pread() { - sed -e "s/pread64: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io + sed -e "s/pread.*: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io } write_block()
tests/xfs/071.out.64 +10 -10
@@ -40,12 +40,12 @@ read 513/1FSB bytes at offset <OFFSET> Writing 512 bytes, offset is +0 (direct=false) -pwrite64: File too large +pwrite: 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 +pwrite: File too large Reading 512 bytes (direct=false) read 0/512 bytes at offset <OFFSET>
@@ -60,12 +60,12 @@ Reading 1 bytes (direct=false) read 1/1 bytes at offset <OFFSET> Writing 1FSB bytes, offset is +0 (direct=true) -pwrite64: File too large +pwrite: 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 +pwrite: File too large Reading 1FSB bytes (direct=true) read 0/1FSB bytes at offset <OFFSET>
@@ -73,32 +73,32 @@ read 0/1FSB bytes at offset <OFFSET> Writing 512 bytes, offset is +0 (direct=false) -pwrite64: File too large +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: File too large Reading 1FSB bytes (direct=true) read 0/1FSB bytes at offset <OFFSET>
tests/xfs/182 +4 -2
@@ -84,8 +84,10 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ + $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ + $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error _scratch_cycle_mount echo "Compare files"
tests/xfs/182.out +1 -1
@@ -5,7 +5,7 @@ Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file2 CoW and unmount -pwrite64: Invalid argument +pwrite: Invalid argument Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 c6ba35da9f73ced20d7781a448cc11d4 SCRATCH_MNT/test-182/file2
Signature · 1 line
2.8.0.rc3
Quoted 8 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Upstream
xfs_iohas been converted to always use LFS compliant (i.e. 64 bit)pwrite()rather thanpwrite64(). Similar changes have been made for multiple syscalls that have "*64" variants. hence the error output of all these commands has changed, such as "pwrite64:
..." to "pwrite: ....".
Quoted 6 lines
Make a filter to catch the *64 variants and strip it, and convert all the golden output to use the non-*64 variant. This will make all golden output matching work correctly regardless of what version of
xfs_iois in use.Signed-off-by Dave Chinner <[email protected]>
Fixes all the xfstests regressions with my newly rebased xfsprogs, so
--D
Quoted 580 lines
--- common/filter | 7 +++++++ tests/btrfs/126 | 4 ++-- tests/btrfs/126.out | 2 +- tests/ext4/306 | 3 ++- tests/ext4/306.out | 2 +- tests/f2fs/001 | 6 ++---- tests/f2fs/001.out | 2 +- tests/generic/171 | 6 ++++-- tests/generic/171.out | 4 ++-- tests/generic/172 | 6 ++++-- tests/generic/172.out | 4 ++-- tests/generic/174 | 6 ++++-- tests/generic/174.out | 4 ++-- tests/generic/230 | 12 ++++++++---- tests/generic/230.out | 8 ++++---- tests/generic/271 | 3 ++- tests/generic/271.out | 2 +- tests/generic/272 | 3 ++- tests/generic/272.out | 2 +- tests/generic/276 | 3 ++- tests/generic/276.out | 2 +- tests/generic/278 | 3 ++- tests/generic/278.out | 2 +- tests/generic/328 | 6 ++++-- tests/generic/328.out | 4 ++-- tests/xfs/071 | 4 ++-- tests/xfs/071.out.64 | 20 ++++++++++---------- tests/xfs/182 | 6 ++++-- tests/xfs/182.out | 2 +- 29 files changed, 81 insertions(+), 57 deletions(-)common/filter +7
-0@@ -226,6 +226,13 @@ _filter_xfs_io() sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infa0-9/.]* [EPGMKiBbytes]*\/sec and [infa0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/" } +# stderr filter for xfs_io to handle change of error output format (e.g. +# pwrite64 -> pwrite). +_filter_xfs_io_error() +{ + sed -e "s/^\(.*\)64\(: .*$\)/\1\2/" +} + _filter_xfs_io_unique() { common_line_filter | _filter_xfs_iotests/btrfs/126 +2
-2@@ -62,8 +62,8 @@ _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # so redirect stdout to seqres.full. # Also, EDQUOTA is expected, which can't be redirected due to the limitation # of _filter_xfs_io, so golden output will include EDQUOTA error message -_pwrite_byte 0xcdcdcdcd 0 1M $SCRATCH_MNT/test_file | _filter_xfs_io \ - >> $seqres.full +_pwrite_byte 0xcdcdcdcd 0 1M $SCRATCH_MNT/test_file 2>&1 >> $seqres.full | \ + _filter_xfs_io_error # Fstests will umount the fs, and at umount time, kernel warning will be # triggeredtests/btrfs/126.out +1
-1@@ -1,2 +1,2 @@ QA output created by 126 -pwrite64: Disk quota exceeded +pwrite: Disk quota exceededtests/ext4/306 +2
-1@@ -57,7 +57,8 @@ $XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io # Create a large non-extent-based file filling the fs; this will run out & fail echo "Create testfile2 to fill the fs" -$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io +$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" 2>&1 | \ + _filter_xfs_io_error df -h $SCRATCH_MNT >> $seqres.full # Grow fs by 512mtests/ext4/306.out +1
-1@@ -3,7 +3,7 @@ Create 1m testfile1 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Create testfile2 to fill the fs -pwrite64: No space left on device +pwrite: No space left on device Resize to 1g append 2m to testfile1 wrote 2097152/2097152 bytes at offset 1048576tests/f2fs/001 +2
-4@@ -69,10 +69,8 @@ $XFS_IO_PROG -t -f -c "falloc 0 5g" $dummyfile | _filter_xfs_io # -ENOSPC should be triggered without any panic echo "==== change i_size & write data ====" -$XFS_IO_PROG \ - -c "truncate 96" \ - -c "pwrite -S 0x58 8192 4096" \ -$testfile | _filter_xfs_io +$XFS_IO_PROG -c "truncate 96" -c "pwrite -S 0x58 8192 4096" $testfile \ + | _filter_xfs_io_error echo "==== check data contents ====" hexdump -C $testfiletests/f2fs/001.out +1
-1@@ -5,7 +5,7 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ==== Fullfill the partition ==== fallocate: No space left on device ==== change i_size & write data ==== -pwrite64: No space left on device +pwrite: No space left on device ==== check data contents ==== 00000000 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 |XXXXXXXXXXXXXXXX| *tests/generic/171 +4
-2@@ -81,7 +81,8 @@ _pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}@@ -89,7 +90,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}tests/generic/171.out +2
-2@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on devicetests/generic/172 +4
-2@@ -77,7 +77,8 @@ _pwrite_byte 0x61 0 $fs_size $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}@@ -85,7 +86,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}tests/generic/172.out +2
-2@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on devicetests/generic/174 +4
-2@@ -82,7 +82,8 @@ _pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}@@ -90,7 +91,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}tests/generic/174.out +2
-2@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on devicetests/generic/230 +8
-4@@ -62,23 +62,27 @@ test_enforcement() # Firstly fit below block soft limit echo "Write 900k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 900k' -c fsync \ - $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Secondly overcome block soft limit echo "Rewrite 1001k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1001k' -c fsync \ - $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Now try to overcome block hardlimit echo "Write 1000k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1000k' -c fsync \ - $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Now sleep for grace time and check that softlimit got enforced sleep $((grace+1)) echo "Write 4096..." su $qa_user -c "$XFS_IO_PROG -c 'truncate 0' -c 'pwrite 0 4096' \ - $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # And now the softlimit test for inodes # First reset space limits so that we don't have problems withtests/generic/230.out +4
-4@@ -7,9 +7,9 @@ QA output created by 230 Write 900k... Rewrite 1001k... Write 1000k... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Write 4096... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Touch 3+4 Touch 5+6 touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded@@ -23,9 +23,9 @@ touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded Write 900k... Rewrite 1001k... Write 1000k... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Write 4096... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Touch 3+4 Touch 5+6 touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceededtests/generic/271 +2
-1@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table _dmerror_unmount _dmerror_mounttests/generic/271.out +1
-1@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 Check for damagetests/generic/272 +2
-1@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error echo "Clean up the mess" _dmerror_unmounttests/generic/272.out +1
-1@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Clean up the mess Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1tests/generic/276 +2
-1@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table rm -rf $testdir/file2 >> $seqres.full 2>&1 _dmerror_unmounttests/generic/276.out +1
-1@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 Check for damagetests/generic/278 +2
-1@@ -82,7 +82,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table echo "Rewrite"tests/generic/278.out +1
-1@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Rewrite Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1tests/generic/328 +4
-2@@ -79,11 +79,13 @@ setquota -u fsgqa 0 1024 0 0 $SCRATCH_MNT _repquota echo "Try to dio write the whole file" -_pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full +_pwrite_byte 0x62 0 $sz $testdir/file1 -d 2>&1 >> $seqres.full | \ + _filter_xfs_io_error _repquota echo "Try to write the whole file" -_pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $sz $testdir/file1 2>&1 >> $seqres.full | \ + _filter_xfs_io_error _repquota echo "Set hard quota to allow rewrite"tests/generic/328.out +2
-2@@ -7,11 +7,11 @@ Set hard quota to prevent rewrite root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Try to dio write the whole file -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Try to write the whole file -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Set hard quota to allow rewritetests/xfs/071 +2
-2@@ -64,12 +64,12 @@ _filter_off() _filter_pwrite() { - sed -e "s/pwrite64: Invalid argument/pwrite64: File too large/g" + sed -e "s/pwrite.*: Invalid argument/pwrite: File too large/g" } _filter_pread() { - sed -e "s/pread64: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io + sed -e "s/pread.*: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io } write_block()tests/xfs/071.out.64 +10
-10@@ -40,12 +40,12 @@ read 513/1FSB bytes at offset <OFFSET> Writing 512 bytes, offset is +0 (direct=false) -pwrite64: File too large +pwrite: 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 +pwrite: File too large Reading 512 bytes (direct=false) read 0/512 bytes at offset <OFFSET>@@ -60,12 +60,12 @@ Reading 1 bytes (direct=false) read 1/1 bytes at offset <OFFSET> Writing 1FSB bytes, offset is +0 (direct=true) -pwrite64: File too large +pwrite: 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 +pwrite: File too large Reading 1FSB bytes (direct=true) read 0/1FSB bytes at offset <OFFSET>@@ -73,32 +73,32 @@ read 0/1FSB bytes at offset <OFFSET> Writing 512 bytes, offset is +0 (direct=false) -pwrite64: File too large +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: File too large Reading 1FSB bytes (direct=true) read 0/1FSB bytes at offset <OFFSET>tests/xfs/182 +4
-2@@ -84,8 +84,10 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ + $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ + $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error _scratch_cycle_mount echo "Compare files"tests/xfs/182.out +1
-1@@ -5,7 +5,7 @@ Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file2 CoW and unmount -pwrite64: Invalid argument +pwrite: Invalid argument Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 c6ba35da9f73ced20d7781a448cc11d4 SCRATCH_MNT/test-182/file2Signature · 6 lines
2.8.0.rc3 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Upstream
xfs_iohas been converted to always use LFS compliant (i.e. 64 bit)pwrite()rather thanpwrite64(). Similar changes have been made for multiple syscalls that have "*64" variants. hence the error output of all these commands has changed, such as "pwrite64:
..." to "pwrite: ....".
Quoted 6 lines
Make a filter to catch the *64 variants and strip it, and convert all the golden output to use the non-*64 variant. This will make all golden output matching work correctly regardless of what version of
xfs_iois in use.Signed-off-by Dave Chinner <[email protected]>
....
Actually, overnight testing found a bug in this patch:
tests/f2fs/001 $XFS_IO_PROG -t -f -c "falloc 0 5g" $dummyfile | _filter_xfs_io · line 73
Quoted 12 lines
tests/f2fs/001 +2
-4@@ -69,10 +69,8 @@ $XFS_IO_PROG -t -f -c "falloc 0 5g" $dummyfile | _filter_xfs_io # -ENOSPC should be triggered without any panic echo "==== change i_size & write data ====" -$XFS_IO_PROG \ - -c "truncate 96" \ - -c "pwrite -S 0x58 8192 4096" \ -$testfile | _filter_xfs_io +$XFS_IO_PROG -c "truncate 96" -c "pwrite -S 0x58 8192 4096" $testfile \ + | _filter_xfs_io_error
This is missing a 2>&1 redirection, so the filter won't work. I'll post and updated patch in a minute.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v2 1/1 filter: xfs_io output has dropped "64" from error messages
From: Dave Chinner <[email protected]>
Upstream xfs_io has been converted to always use LFS compliant (i.e. 64 bit) pwrite() rather than pwrite64(). Similar changes have been made for multiple syscalls that have "*64" variants. hence the error output of all these commands has changed, such as "pwrite64:
..." to "pwrite: ....".
Make a filter to catch the *64 variants and strip it, and convert all the golden output to use the non-*64 variant. This will make all golden output matching work correctly regardless of what version of xfs_io is in use.
---
V2: add redirect to f2fs/001
common/filter | 7 +++++++ tests/btrfs/126 | 4 ++-- tests/btrfs/126.out | 2 +- tests/ext4/306 | 3 ++- tests/ext4/306.out | 2 +- tests/f2fs/001 | 6 ++---- tests/f2fs/001.out | 2 +- tests/generic/171 | 6 ++++-- tests/generic/171.out | 4 ++-- tests/generic/172 | 6 ++++-- tests/generic/172.out | 4 ++-- tests/generic/174 | 6 ++++-- tests/generic/174.out | 4 ++-- tests/generic/230 | 12 ++++++++---- tests/generic/230.out | 8 ++++---- tests/generic/271 | 3 ++- tests/generic/271.out | 2 +- tests/generic/272 | 3 ++- tests/generic/272.out | 2 +- tests/generic/276 | 3 ++- tests/generic/276.out | 2 +- tests/generic/278 | 3 ++- tests/generic/278.out | 2 +- tests/generic/328 | 6 ++++-- tests/generic/328.out | 4 ++-- tests/xfs/071 | 4 ++-- tests/xfs/071.out.64 | 20 ++++++++++---------- tests/xfs/182 | 6 ++++-- tests/xfs/182.out | 2 +- 29 files changed, 81 insertions(+), 57 deletions(-)
common/filter +7 -0
@@ -226,6 +226,13 @@ _filter_xfs_io() sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infa0-9/.]* [EPGMKiBbytes]*\/sec and [infa0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/" } +# stderr filter for xfs_io to handle change of error output format (e.g. +# pwrite64 -> pwrite). +_filter_xfs_io_error() +{ + sed -e "s/^\(.*\)64\(: .*$\)/\1\2/" +} + _filter_xfs_io_unique() { common_line_filter | _filter_xfs_io
tests/btrfs/126 +2 -2
@@ -62,8 +62,8 @@ _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # so redirect stdout to seqres.full. # Also, EDQUOTA is expected, which can't be redirected due to the limitation # of _filter_xfs_io, so golden output will include EDQUOTA error message -_pwrite_byte 0xcdcdcdcd 0 1M $SCRATCH_MNT/test_file | _filter_xfs_io \ - >> $seqres.full +_pwrite_byte 0xcdcdcdcd 0 1M $SCRATCH_MNT/test_file 2>&1 >> $seqres.full | \ + _filter_xfs_io_error # Fstests will umount the fs, and at umount time, kernel warning will be # triggered
tests/btrfs/126.out +1 -1
@@ -1,2 +1,2 @@ QA output created by 126 -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded
tests/ext4/306 +2 -1
@@ -57,7 +57,8 @@ $XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io # Create a large non-extent-based file filling the fs; this will run out & fail echo "Create testfile2 to fill the fs" -$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io +$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" 2>&1 | \ + _filter_xfs_io_error df -h $SCRATCH_MNT >> $seqres.full # Grow fs by 512m
tests/ext4/306.out +1 -1
@@ -3,7 +3,7 @@ Create 1m testfile1 wrote 1048576/1048576 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Create testfile2 to fill the fs -pwrite64: No space left on device +pwrite: No space left on device Resize to 1g append 2m to testfile1 wrote 2097152/2097152 bytes at offset 1048576
tests/f2fs/001 +2 -4
@@ -69,10 +69,8 @@ $XFS_IO_PROG -t -f -c "falloc 0 5g" $dummyfile | _filter_xfs_io # -ENOSPC should be triggered without any panic echo "==== change i_size & write data ====" -$XFS_IO_PROG \ - -c "truncate 96" \ - -c "pwrite -S 0x58 8192 4096" \ -$testfile | _filter_xfs_io +$XFS_IO_PROG -c "truncate 96" -c "pwrite -S 0x58 8192 4096" $testfile 2>&1 \ + | _filter_xfs_io_error echo "==== check data contents ====" hexdump -C $testfile
tests/f2fs/001.out +1 -1
@@ -5,7 +5,7 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ==== Fullfill the partition ==== fallocate: No space left on device ==== change i_size & write data ==== -pwrite64: No space left on device +pwrite: No space left on device ==== check data contents ==== 00000000 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 |XXXXXXXXXXXXXXXX| *
tests/generic/171 +4 -2
@@ -81,7 +81,8 @@ _pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
@@ -89,7 +90,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
tests/generic/171.out +2 -2
@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on device
tests/generic/172 +4 -2
@@ -77,7 +77,8 @@ _pwrite_byte 0x61 0 $fs_size $testdir/eat_my_space >> $seqres.full 2>&1 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
@@ -85,7 +86,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1)" +out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
tests/generic/172.out +2 -2
@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on device
tests/generic/174 +4 -2
@@ -82,7 +82,8 @@ _pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2 sync echo "CoW the big file" -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
@@ -90,7 +91,8 @@ echo ${out} echo "Remount and try CoW again" _scratch_cycle_mount -out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)" +out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ + _filter_xfs_io_error)" echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC" echo ${out} >> $seqres.full 2>&1 echo ${out}
tests/generic/174.out +2 -2
@@ -4,6 +4,6 @@ Reformat with appropriate size Create a big file and reflink it Allocate the rest of the space CoW the big file -pwrite64: No space left on device +pwrite: No space left on device Remount and try CoW again -pwrite64: No space left on device +pwrite: No space left on device
tests/generic/230 +8 -4
@@ -62,23 +62,27 @@ test_enforcement() # Firstly fit below block soft limit echo "Write 900k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 900k' -c fsync \ - $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Secondly overcome block soft limit echo "Rewrite 1001k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1001k' -c fsync \ - $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file1" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Now try to overcome block hardlimit echo "Write 1000k..." su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1000k' -c fsync \ - $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Now sleep for grace time and check that softlimit got enforced sleep $((grace+1)) echo "Write 4096..." su $qa_user -c "$XFS_IO_PROG -c 'truncate 0' -c 'pwrite 0 4096' \ - $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full + $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \ + _filter_xfs_io_error | tee -a $seqres.full repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # And now the softlimit test for inodes # First reset space limits so that we don't have problems with
tests/generic/230.out +4 -4
@@ -7,9 +7,9 @@ QA output created by 230 Write 900k... Rewrite 1001k... Write 1000k... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Write 4096... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Touch 3+4 Touch 5+6 touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
@@ -23,9 +23,9 @@ touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded Write 900k... Rewrite 1001k... Write 1000k... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Write 4096... -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded Touch 3+4 Touch 5+6 touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
tests/generic/271 +2 -1
@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/271.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 Check for damage
tests/generic/272 +2 -1
@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error echo "Clean up the mess" _dmerror_unmount
tests/generic/272.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Clean up the mess Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1
tests/generic/276 +2 -1
@@ -81,7 +81,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table rm -rf $testdir/file2 >> $seqres.full 2>&1 _dmerror_unmount
tests/generic/276.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 Check for damage
tests/generic/278 +2 -1
@@ -82,7 +82,8 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + 2>&1 >> $seqres.full | _filter_xfs_io_error _dmerror_load_working_table echo "Rewrite"
tests/generic/278.out +1 -1
@@ -5,7 +5,7 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2 CoW and unmount -pwrite64: Input/output error +pwrite: Input/output error Rewrite Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1
tests/generic/328 +4 -2
@@ -79,11 +79,13 @@ setquota -u fsgqa 0 1024 0 0 $SCRATCH_MNT _repquota echo "Try to dio write the whole file" -_pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full +_pwrite_byte 0x62 0 $sz $testdir/file1 -d 2>&1 >> $seqres.full | \ + _filter_xfs_io_error _repquota echo "Try to write the whole file" -_pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full +_pwrite_byte 0x62 0 $sz $testdir/file1 2>&1 >> $seqres.full | \ + _filter_xfs_io_error _repquota echo "Set hard quota to allow rewrite"
tests/generic/328.out +2 -2
@@ -7,11 +7,11 @@ Set hard quota to prevent rewrite root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Try to dio write the whole file -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Try to write the whole file -pwrite64: Disk quota exceeded +pwrite: Disk quota exceeded root -- 0 0 0 4 0 0 fsgqa +- 3072 0 1024 3 0 0 Set hard quota to allow rewrite
tests/xfs/071 +2 -2
@@ -64,12 +64,12 @@ _filter_off() _filter_pwrite() { - sed -e "s/pwrite64: Invalid argument/pwrite64: File too large/g" + sed -e "s/pwrite.*: Invalid argument/pwrite: File too large/g" } _filter_pread() { - sed -e "s/pread64: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io + sed -e "s/pread.*: Invalid argument/read 0\/$bytes bytes at offset <OFFSET>/g" | _filter_io } write_block()
tests/xfs/071.out.64 +10 -10
@@ -40,12 +40,12 @@ read 513/1FSB bytes at offset <OFFSET> Writing 512 bytes, offset is +0 (direct=false) -pwrite64: File too large +pwrite: 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 +pwrite: File too large Reading 512 bytes (direct=false) read 0/512 bytes at offset <OFFSET>
@@ -60,12 +60,12 @@ Reading 1 bytes (direct=false) read 1/1 bytes at offset <OFFSET> Writing 1FSB bytes, offset is +0 (direct=true) -pwrite64: File too large +pwrite: 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 +pwrite: File too large Reading 1FSB bytes (direct=true) read 0/1FSB bytes at offset <OFFSET>
@@ -73,32 +73,32 @@ read 0/1FSB bytes at offset <OFFSET> Writing 512 bytes, offset is +0 (direct=false) -pwrite64: File too large +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: 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 +pwrite: File too large Reading 1FSB bytes (direct=true) read 0/1FSB bytes at offset <OFFSET>
tests/xfs/182 +4 -2
@@ -84,8 +84,10 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "cowextsize" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -R -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ + $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $real_blksz 0 $((filesize + 1))" \ + $testdir/file2 2>&1 >> $seqres.full | _filter_xfs_io_error _scratch_cycle_mount echo "Compare files"
tests/xfs/182.out +1 -1
@@ -5,7 +5,7 @@ Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file2 CoW and unmount -pwrite64: Invalid argument +pwrite: Invalid argument Compare files 2909feb63a37b0e95fe5cfb7f274f7b1 SCRATCH_MNT/test-182/file1 c6ba35da9f73ced20d7781a448cc11d4 SCRATCH_MNT/test-182/file2