@@ -80,7 +80,11 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
+urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \
+ -c "fdatasync" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "pwrite did not fail"
+
_dmerror_load_working_table
_dmerror_unmount
_dmerror_mount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file2
CoW and unmount
-fdatasync: Input/output error
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1
Check for damage
@@ -80,7 +80,10 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
+urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \
+ -c "fdatasync" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "pwrite did not fail"
echo "Clean up the mess"
_dmerror_unmount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file2
CoW and unmount
-fdatasync: Input/output error
Clean up the mess
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1
@@ -80,7 +80,7 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
_dmerror_load_working_table
rm -rf $testdir/file2 >> $seqres.full 2>&1
_dmerror_unmount
@@ -81,7 +81,10 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full
+urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \
+ -c "fdatasync" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "pwrite did not fail"
_dmerror_load_working_table
echo "Rewrite"
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file2
CoW and unmount
-fdatasync: Input/output error
Rewrite
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1
@@ -81,8 +81,9 @@ 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 \
- 2>&1 >> $seqres.full | _filter_xfs_io_error
+urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "dio pwrite did not fail"
_dmerror_load_working_table
_dmerror_unmount
_dmerror_mount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2
CoW and unmount
-pwrite: Input/output error
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1
Check for damage
@@ -81,8 +81,9 @@ 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 \
- 2>&1 >> $seqres.full | _filter_xfs_io_error
+urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "dio pwrite did not fail"
echo "Clean up the mess"
_dmerror_unmount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2
CoW and unmount
-pwrite: Input/output error
Clean up the mess
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1
@@ -82,7 +82,7 @@ echo "CoW and unmount"
sync
_dmerror_load_error_table
$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \
- 2>&1 >> $seqres.full | _filter_xfs_io_error
+ >> $seqres.full 2>&1
_dmerror_load_working_table
rm -rf $testdir/file2 >> $seqres.full 2>&1
_dmerror_unmount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2
CoW and unmount
-pwrite: Input/output error
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1
Check for damage
@@ -82,8 +82,9 @@ 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 \
- 2>&1 >> $seqres.full | _filter_xfs_io_error
+urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "dio pwrite did not fail"
_dmerror_load_working_table
echo "Rewrite"
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2
CoW and unmount
-pwrite: Input/output error
Rewrite
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1
@@ -80,8 +80,8 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1)
-cat $TEST_DIR/mwrite.out | tee -a $seqres.full
+$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
+ -c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
_dmerror_load_working_table
_dmerror_unmount
_dmerror_mount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file2
CoW and unmount
-msync: Input/output error
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1
Check for damage
@@ -80,8 +80,8 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1)
-cat $TEST_DIR/mwrite.out | tee -a $seqres.full
+$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
+ -c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
echo "Clean up the mess"
_dmerror_unmount
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file2
CoW and unmount
-msync: Input/output error
Clean up the mess
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1
@@ -80,8 +80,7 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1)
-cat $TEST_DIR/mwrite.out | tee -a $seqres.full
+$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
_dmerror_load_working_table
rm -rf $testdir/file2 >> $seqres.full 2>&1
_dmerror_unmount
@@ -81,8 +81,10 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
-urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1)
-cat $TEST_DIR/mwrite.out | tee -a $seqres.full
+urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \
+ -c "msync -s 0 $filesize" $testdir/file2 2>&1)
+echo $urk >> $seqres.full
+echo "$urk" | grep -q "error" || _fail "mwrite did not fail"
_dmerror_load_working_table
echo "Rewrite"
@@ -5,7 +5,6 @@ Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file2
CoW and unmount
-msync: Input/output error
Rewrite
Compare files
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1
When we're using dm-error to simulate failed devices, we don't really know if the write or the fdatasync is going to receive the EIO. For tests that make a single (failed) write attempt and never retry, it's sufficient to check that the file md5 doesn't change after recovery. For tests that /do/ retry the write, we should capture the entire output and just look for the word error instead of enshrining the exact perror message (filename/function call and everything) in the golden output. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- tests/generic/265 | 6 +++++- tests/generic/265.out | 1 - tests/generic/266 | 5 ++++- tests/generic/266.out | 1 - tests/generic/267 | 2 +- tests/generic/268 | 5 ++++- tests/generic/268.out | 1 - tests/generic/271 | 5 +++-- tests/generic/271.out | 1 - tests/generic/272 | 5 +++-- tests/generic/272.out | 1 - tests/generic/276 | 2 +- tests/generic/276.out | 1 - tests/generic/278 | 5 +++-- tests/generic/278.out | 1 - tests/generic/279 | 4 ++-- tests/generic/279.out | 1 - tests/generic/281 | 4 ++-- tests/generic/281.out | 1 - tests/generic/282 | 3 +-- tests/generic/283 | 6 ++++-- tests/generic/283.out | 1 - 22 files changed, 33 insertions(+), 29 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html