]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
filters: add a filter that accepts EIO instead of other errors
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 21:01:01 +0000 (08:01 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:14:17 +0000 (22:14 +0800)
commitc94bc7f99121730930e9295637f52c60356413fd
tree80113530ae449e61a6d9039ffa9880e7868e7a11
parentdbd03a8afb97371521c1ebd9e5df4e1208bee578
filters: add a filter that accepts EIO instead of other errors

Running a dm-flakey or dm-error test that loads a table that returns
EIO to all IO and then running a command that is expected to fail
with a specific error is racy.

If there is memory pressure at the same time that the table is
loaded, cached inodes can be turfed from memory and the command then
needs to read the inode it is about to act on from disk again. This
results in the inode read getting EIO and failing (e.g. xfs_io will
return a stat() error) rather than having the desired operation
fail.

This results in spurious test failures that look like this:

generic/331       - output mismatch (see /mnt/xfs/runner-41/results-2024-11-20-10:57:31/xfs/generic/331.out.bad)
    --- tests/generic/331.out   2022-12-21 15:53:25.487044098 +1100
    +++ /mnt/xfs/runner-41/results-2024-11-20-10:57:31/xfs/generic/331.out.bad  2024-11-20 11:02:12.123572607 +1100
    @@ -5,7 +5,8 @@
     1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-331/file1
     1886e67cf8783e89ce6ddc5bb09a3944  SCRATCH_MNT/test-331/file2
     CoW and unmount
    -fdatasync: Input/output error
    +/mnt/xfs/runner-41/scratch/test-331/file2: Input/output error
    +stat: Input/output error
     Compare files
    ...

Add a new "flakey EIO filter" that will catch -any- EIO error from
the command and change it to the error we expected to see.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/filter
tests/btrfs/160
tests/generic/252
tests/generic/329
tests/generic/331
tests/generic/484
tests/generic/743
tests/xfs/237
tests/xfs/240