mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
702421f528
I'm working on a set of kernel patches to change how writeback errors are handled and reported in the kernel. Instead of reporting a writeback error to only the first fsync caller on the file, it has the the kernel report them once on every file description that was open at the time of the error. This patch adds a test for this new behavior. Basically, open many fds to the same file, turn on dm_error, write to each of the fds, and then fsync them all to ensure that they all get an error back. To do that, I'm adding a new tools/dmerror script that the C program can use to load the error table from the script. It's also suitable for setting up, frobbing and tearing down a dmerror device for by-hand testing. For now, only ext2/3/4 and xfs are whitelisted on this test, since those filesystems are included in the initial patchset. We can add to that as we convert filesystems, and eventually make it a more general test. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
90 lines
2.7 KiB
Plaintext
90 lines
2.7 KiB
Plaintext
==============================
|
|
AUXILIARY PROGRAMS FOR TESTING
|
|
==============================
|
|
|
|
Not everything a test script can do is easily done within a test script;
|
|
sometimes it makes a lot more sense to write auxiliary program in C and have
|
|
the test script call them. Auxiliary commands can be found in the src/
|
|
directory and in other packages.
|
|
|
|
Tests wanting to use an auxiliary program found in the src/ directory should
|
|
note the dependency with:
|
|
|
|
_require_test_program "<program-name>"
|
|
|
|
|
|
Contents:
|
|
|
|
- af_unix -- Create an AF_UNIX socket
|
|
- dmerror -- fault injection block device control
|
|
- fsync-err -- tests fsync error reporting after failed writeback
|
|
- open_by_handle -- open_by_handle_at syscall exercise
|
|
- stat_test -- statx syscall exercise
|
|
- t_dir_type -- print directory entries and their file type
|
|
- xfs_io -- General I/O operation exercise
|
|
|
|
|
|
==================
|
|
QUICK DESCRIPTIONS
|
|
==================
|
|
|
|
af_unix
|
|
|
|
The af_unix program creates an AF_UNIX socket at the given location.
|
|
|
|
dmerror
|
|
|
|
dmerror is a program for creating, destroying and controlling a
|
|
fault injection device. The device can be set up as initially
|
|
working and then flip to throwing errors for testing purposes.
|
|
|
|
fsync-err
|
|
|
|
Specialized program for testing how the kernel reports errors that
|
|
occur during writeback. Works in conjunction with the dmerror script
|
|
in tools/ to write data to a device, and then force it to fail
|
|
writeback and test that errors are reported during fsync and cleared
|
|
afterward.
|
|
|
|
open_by_handle
|
|
|
|
The open_by_handle program exercises the open_by_handle_at() system
|
|
call. It can check if file handles are valid or stale after certain
|
|
filesystem operations.
|
|
|
|
See also:
|
|
_require_exportfs
|
|
|
|
stat_test
|
|
|
|
The stat_test program is primarily designed to exercise the statx()
|
|
system call. It can check statx() against fstatat() and it can
|
|
compare and check various file attributes.
|
|
|
|
See also:
|
|
_require_statx
|
|
|
|
|
|
t_dir_type
|
|
|
|
The t_dir_type program exercises the getdents64() system call.
|
|
It prints directory entry names returned from getdents64() and
|
|
thier d_type, optionally filtered by type or by inode number.
|
|
|
|
xfs_io
|
|
|
|
The xfs_io program can be found in the xfsprogs package and can be used
|
|
to perform sequences of I/O commands, though it is limited to what it
|
|
can do on open files.
|
|
|
|
xfs_io is a debugging tool that is aimed at examining regular file I/O
|
|
paths rather than a raw XFS volume itself. These code paths include
|
|
not only the obvious read/write/mmap interfaces for manipulating files,
|
|
but also cover all of the XFS extensions (such as space preallocation,
|
|
additional inode flags, etc).
|
|
|
|
Most of its commands can also be used with other filesystems.
|
|
|
|
See also:
|
|
_require_xfs_io_command
|