generic/250: ignore xfs_io IO errors when writing to dmerror device
PATCH 1/1 generic/250: ignore xfs_io IO errors when writing to dmerror device
When testing with data=journal ext4, direct write to dmerror device doesn't return EIO, because ext4 turns direct write to buffered write in data=journal mode and all data is written to journal buffer. The write only fails later when commiting journal and error messages can be seen in dmesg.
As the test is checking on the md5 checksum of the test file, it's ok to ignore the IO error returned by xfs_io, as long as the checksums match the golden image.
---
Not returning errors to userspace properly is kind of an ext4 bug in journal mode, but ext4 always behaves this way. So I think instead of fixing ext4, this is the easiest way to make generic/250 work with journal mode ext4.
tests/generic/250 | 3 ++- tests/generic/250.out | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
tests/generic/250 +2 -1
@@ -83,7 +83,8 @@ echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full 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 \ + >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/250.out +0 -1
@@ -4,7 +4,6 @@ Create the original files Compare files ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 CoW and unmount -pwrite64: Input/output error Compare files 3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 Check for damage
Signature · 1 line
2.5.5
Quoted 10 lines · Eryu Guan
When testing with data=journal ext4, direct write to dmerror device doesn't return EIO, because ext4 turns direct write to buffered write in data=journal mode and all data is written to journal buffer. The write only fails later when commiting journal and error messages can be seen in dmesg.
As the test is checking on the md5 checksum of the test file, it's ok to ignore the IO error returned by
xfs_io, as long as the checksums match the golden image.
Quoted 6 lines
Signed-off-by Eryu Guan <[email protected]>---
Not returning errors to userspace properly is kind of an ext4 bug in journal mode, but ext4 always behaves this way. So I think instead of fixing ext4, this is the easiest way to make generic/250 work with journal mode ext4.
/me wonders why _require_odirect doesn't _notrun in situations where we *know* ahead of time that we're not going to get O_DIRECT semantics, but whatever. It's no big deal if we shuffle the -EIO message to seqres.full.
tests/generic/250 echo "CoW and unmount"
Quoted 9 lines
tests/generic/250 | 3 ++- tests/generic/250.out | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)tests/generic/250 +0
-0@@ -83,7 +83,8 @@ echo "CoW and unmount"
Er... that should be 'echo "Write and unmount"', oops, sorry about that. There's no COW going on here.
--D
Quoted 28 lines
tests/generic/250 +2
-1$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full 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 \ + >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mounttests/generic/250.out +0
-1@@ -4,7 +4,6 @@ Create the original files Compare files ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 CoW and unmount -pwrite64: Input/output error Compare files 3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 Check for damageSignature · 6 lines
2.5.5 -- 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 14 lines · Darrick J. Wong
Quoted 13 lines · Eryu Guan
When testing with data=journal ext4, direct write to dmerror device doesn't return EIO, because ext4 turns direct write to buffered write in data=journal mode and all data is written to journal buffer. The write only fails later when commiting journal and error messages can be seen in dmesg.
As the test is checking on the md5 checksum of the test file, it's ok to ignore the IO error returned by
xfs_io, as long as the checksums match the golden image.Signed-off-by Eryu Guan <[email protected]>---
Quoted 7 lines
Quoted 3 lines
Not returning errors to userspace properly is kind of an ext4 bug in journal mode, but ext4 always behaves this way. So I think instead of fixing ext4, this is the easiest way to make generic/250 work with journal mode ext4.
/me wonders why
_require_odirectdoesn't_notrunin situations where we *know* ahead of time that we're not going to getO_DIRECTsemantics, but whatever. It's no big deal if we shuffle the-EIOmessage to seqres.full.
I think that's because direct write falls back to buffered write silently on journal mode ext4, so the _require_odirect check returns pass.
Quoted 5 lines
Quoted 5 lines
tests/generic/250 | 3 ++- tests/generic/250.out | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 8 lines
tests/generic/250 echo "CoW and unmount"
Quoted 5 lines
tests/generic/250 +0
-0@@ -83,7 +83,8 @@ echo "CoW and unmount"Er... that should be 'echo "Write and unmount"', oops, sorry about that. There's no COW going on here.
I can fix that in v2 :)
Thanks,
Eryu
Quoted 31 lines
--D
Quoted 28 lines
tests/generic/250 +2
-1$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full 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 \ + >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mounttests/generic/250.out +0
-1@@ -4,7 +4,6 @@ Create the original files Compare files ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 CoW and unmount -pwrite64: Input/output error Compare files 3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 Check for damageSignature · 6 lines
2.5.5 -- 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
PATCH v2 1/1 generic/250: ignore xfs_io IO errors when writing to dmerror device
In reply to Eryu GuanWhen testing with data=journal ext4, direct write to dmerror device doesn't return EIO, because ext4 turns direct write to buffered write in data=journal mode and all data is written to journal buffer. The write only fails later when commiting journal and error messages can be seen in dmesg.
As the test is checking on the md5 checksum of the test file, it's ok to ignore the IO error returned by xfs_io, as long as the checksums match the golden image.
---
v2:
- Replace "CoW" with "Write" and update .out accordingly
tests/generic/250 | 5 +++-- tests/generic/250.out | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-)
tests/generic/250 +3 -2
@@ -79,11 +79,12 @@ _dmerror_mount echo "Compare files" md5sum $testdir/file2 | _filter_scratch -echo "CoW and unmount" +echo "Write and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full 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 \ + >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/250.out +1 -2
@@ -3,8 +3,7 @@ Format and mount Create the original files Compare files ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 -CoW and unmount -pwrite64: Input/output error +Write and unmount Compare files 3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 Check for damage
Signature · 1 line
2.5.5
Quoted 9 lines · Eryu Guan
When testing with data=journal ext4, direct write to dmerror device doesn't return EIO, because ext4 turns direct write to buffered write in data=journal mode and all data is written to journal buffer. The write only fails later when commiting journal and error messages can be seen in dmesg.
As the test is checking on the md5 checksum of the test file, it's ok to ignore the IO error returned by
xfs_io, as long as the checksums match the golden image.
Looks fine to me,
--D
Quoted 51 lines
Signed-off-by Eryu Guan <[email protected]>---
v2:
- Replace "CoW" with "Write" and update .out accordinglytests/generic/250 | 5 +++-- tests/generic/250.out | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-)tests/generic/250 +3
-2@@ -79,11 +79,12 @@ _dmerror_mount echo "Compare files" md5sum $testdir/file2 | _filter_scratch -echo "CoW and unmount" +echo "Write and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full 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 \ + >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mounttests/generic/250.out +1
-2@@ -3,8 +3,7 @@ Format and mount Create the original files Compare files ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 -CoW and unmount -pwrite64: Input/output error +Write and unmount Compare files 3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 Check for damageSignature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html