When _require_xfs_io_command is passed command parameters,
the resulting error from invalid parameters may be ignored.
For example, the following bogus params would not abort the test:
_require_xfs_io_command "falloc" "-X"
_require_xfs_io_command "fiemap" "-X"
Fix this by looking for the relevant error message.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When we're creating a populated xfs image, turn on quotas so that we can
fuzz those fields too.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
As part of upstreaming, the xfs_db fuzz command change the help output
which breaks the fuzzers' ability to detect fuzz verbs. Fix that.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Refactor the XFS error injection helpers to use the new errortag
interface to configure error injection. If that isn't present, fall
back either to the xfs_io/ioctl based injection or the older sysfs
knobs. Refactor existing testcases to use the new helpers.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
On RHEL6.9GA, generic/097 fails for ext4 because _test_cycle_mount()
remount ext4 without the user_xattr option, so extended attributes
are not supported by ext4.
On some old kernels, ext4 filesystem can not be mounted with acl and
user_xattr options by default. The following patch has enabled
these options by default:
'ea6633369458("ext4: enable acls and user_xattr by default")'
We add acl and user_xattr support in _test_mount_opts(), and it
works normally on all kernels.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
TEST_FS_MOUNT_OPTS doesn't get reset before parsing next config
section, this will cause unexpected TEST_FS_MOUNT_OPTS in test,
because it can be assigned some fs-specific mount options in
_test_mount_opts, which might not be supported by the filesystem in
next config section. And MOUNT_OPTIONS is reset, I don't see why
TEST_FS_MOUNT_OPTS shouldn't be.
Also update README.config-sections to reflect this change and fix
typos (replace MOUNT_OPTIONS with TEST_FS_MOUNT_OPTS).
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Some tests and common helpers don't properly clean up tmp files and
leave them behind in /tmp dir, and these tmp files are accumulating
over time.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The warning in fs/iomap.c::iomap_dio_actor() could be triggered when
mixing dio and mmap I/O on the same sparse file. Several tests could
hit this warning now, like generic/095 generic/224 and generic/446.
So add this expected warning to whitelist too.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When checking a filesystem, explicitly run xfs_scrub in dry run mode
so that it will not ever try to preen, fix, or optimize anything.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
1) This pattern is repeated in several seek_data/hole tests
(e.g. generic/285, generic/436, generic/445 generic/448)
and generic/009. A common _ext4_disable_extent_zeroout()
helper could be added and applied by generic/009 and
_require_seek_data_hole().
2) On some old kernels(e.g. v3.1-v3.6), when vfs recognizes
SEEK_DATA/HOLE flag && ext4 has no extent zeroout tunable
in sysfs, these cases may trigger "sysfs entry not found"
issue. We can add check if extent_max_zeroout_kb exists
on ext4 filesystem.
The extent_max_zeroout_kb is introduced by:
'67a5da564f97 ("ext4: make the zero-out chunk size tunable")'
3) Declare several vars as local in _require_seek_data_hole().
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
As xfstests is no longer supported on IRIX, remove IRIX-specific code
from the common helper scripts.
[eguan: add _filter_devchar back as xfs/061 needs it]
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This IRIX-specific ACL test was nearly identical to shared/051, which
has been better maintained and will be made a generic test in the next
commit. Therefore, remove the existing generic/099.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Currently we just have this test run on a whitelist of filesystems,
but it would be best to be able to run it on all of them. The
problem is that a lot of filesystems basically shut down once they
hit metadata errors.
Allow the fsync-err testcase to operate in two different modes. One
mode just does basic testing to ensure that we get an error back on
all fd's when we fsync. The other does a more thorough test to
ensure that we get back 0 on subsequent fsyncs when there hasn't
been any write activity.
For now, we just opt-in to the more thorough testing on certain
filesystems: xfs, ext3 and ext4 on the generic test. All other
filesystems will run in simple mode.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
As of now xfstests decides if a filesystem supports attributes by trying
to write one to the mount point. For some reason this fails on reiserfs,
making it impossible to run tests that _require_attrs.
Fix this by checking against $TEST_DIR/syscalltest instead of $TEST_DIR.
This is probably what was intended, since the syscalltest file is touched
right before running attr. It is also consistent with how the check for
acl support is done.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add support for jfs in _scratch_mkfs_sized. Fix the block size in
4096, which seems to be the only option in jfs_mkfs.
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The helper is used to test if a specific filesystem feature can
be enabled. Currently only implemented testing overlayfs features.
Overalyfs features (e.g. redirect_dir, index) are configurable from
Kconfig (the build default), by module parameter (the system default)
and per mount using the mount option ${feature}=[on|off].
The helper is going to be used by overlay tests, which depend
on the inodes index feature.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
On xfs filesystem, the following patch fixed system crash caused by
this race, but it introduced the __xfs_get_blocks() warning when the
race occurred:
04197b3 ("xfs: don't BUG() on mixed direct and mapped I/O")
On upstream kernel, the fix patch was cleared by:
acdda3a ("xfs: use iomap_dio_rw")
When the fix patch was applied and not cleared(e.g, on RHEL7.4),
this case triggered the __xfs_get_blocks() warning as expected.
Moreover, generic/095 may reproduce the same warning occasionally.
So we could add __xfs_get_blocks() into _filter_xfs_dmesg.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The ext4 online scrub program is no longer under active development,
so remove all the test code that tried to use it.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When we call _require_xfs_io_command for the scrub ioctl, we have to
actually try calling the ioctl to make sure that the ioctl is
present on the running kernel.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Record the external log and realtime device configurations when we
create a sample filesystem. ext4 tightly binds to external logs,
so we have to preserve that too.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
generic/247 reproduces some of the same, expected warnings from XFS
as generic/095. These warnings occur due to mixed buffered/mapped
I/O racing with direct I/O to the same file.
generic/095 contains a custom dmesg filter to prevent test failure
in the event of such warnings. Lift the helper from generic/095 to
common/xfs and reuse it in generic/247 to implement the same
behavior.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
_require_xfs_io_command() isn't handling the case where the
requested syscall isn't available. To fix this simply check the
error returned by xfs_io.
Usually the userspace should be synced with kernelspace, the case
that a syscall is supported by userspace tool but not kernelspace
should not happen, but in rare test setups it's possible, e.g.
building an initramfs that contains the testing tools from a recent
distro, and running the tests against an old kernel (which does not
include such syscall).
[ eguan: it's not copy_file_range syscall specific issue, update
summary and commit log, and provide more background information ]
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
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>