filter: xfs_io output has dropped "64" from error messages

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.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Dave Chinner
2016-11-03 08:15:25 +11:00
committed by Eryu Guan
parent efef020df5
commit c52086226b
29 changed files with 81 additions and 57 deletions
+4 -2
View File
@@ -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}
+2 -2
View File
@@ -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
+4 -2
View File
@@ -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}
+2 -2
View File
@@ -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
+4 -2
View File
@@ -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}
+2 -2
View File
@@ -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
+8 -4
View File
@@ -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
+4 -4
View File
@@ -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
+2 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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"
+1 -1
View File
@@ -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
+4 -2
View File
@@ -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"
+2 -2
View File
@@ -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