Commit 2b4eae7fd8 ("common/rc: add scratch shutdown support for
overlayfs") added a _require_local_device check to generic tests 042
and 050. However, for test 050, this check was added _before_
actually verifying that a SCRATCH_DEV actually exists. This patch
simply re-orders the _require_local_device to the right place.
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test log recovery with repeated (simulated) disk failures. We kick
off fsstress on the scratch fs, then switch out the underlying
device with dm-error to see what happens when the disk goes down.
Having taken down the fs in this manner, remount it and repeat.
This test is a Good Enough (tm) simulation of our internal multipath
failure testing efforts.
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>
An 8 MB file system may not be big enough for certain file system
configurations --- in particular, if the inode size is 2048 bytes.
Make the test file system 10MB instead.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test case generic/399 hardcodes "-O encrypt" in MKFS_OPTIONS when
calling _scratch_mkfs_sized, which only works with the mkfs of
certain filesystems. Create a new helper,
_scratch_mkfs_sized_encrypted, for handling the differences between
the mkfs tools of different filesystems. It also allows those
filesystems whose mkfs doesn't accept "-O encrypt" to skip the test
gracefully until proper support is added for them in the helper.
ubifs is not supported in the new helper despite supporting
encryption, as _scratch_mkfs_sized has no ubifs support and adding
that should be done in a separate patch.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Btrfs qgroup also supports to limit the usage of specified qgroups.
It's possible to enable qgroup but doesn't enable limit.
(Most user won't use qgroup limit for various problems)
So add a new test group 'limit' for btrfs, as a subset of existing
'qgroup' group.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Getting xfs/040 to "pass" takes a bit of effort, however the effort
to require updating xfsprogs is purely an xfsprogs maintainer task
only. There no functional gain by users of xfs or a QA team to get
this test to pass. This is not trivial from the current description
so document this.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Inspired by syncfs bug of overlayfs which does not sync dirtyinodes
in underlying filesystem.
Run syncfs and shutdown filesystem(or underlying filesystem of
overlayfs) to check syncfs result.
Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Enable shutdown tests on overlayfs. This requires configuring
overlayfs with TEST|SCRATCH_DEV pointing to block device, which act
as base fs of overlay. The legacy config (pointing TEST|SCRATCH_DEV
to existing directories) won't support shutdown.
Extend _require_scratch_shutdown() to deal with overlay by checking
shutdown support on $OVL_BASE_SCRATCH_MNT instead of $SCRATCH_MNT,
so we check shutdown support status against the underlying upper fs
of overlay.
Introduce new _scratch_shutdown() helper to do the actual shutdown
work and shutdown upper fs in the case of overlay. Also converting
existing bare 'src/godown' calls to use this helper to avoid false
failures when testing overlayfs.
generic/042 and generic/050 assume $SCRATCH_DEV to be a local
device, so add _require_local_device $SCRATCH_DEV rule.
[eguan: rewrite commit log]
Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add a check for the return value of getcwd(). Fix another check
which mistakenly checks if the return value is less than zero
instead of checking whether the return value is NULL.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This patch plugs what we think are the remaining sources of valgrind
noise we found when running fsstress under valgrind. The noise is
caused by memory being left unfreed before process termination.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
We're removing from XFS the ability to perform no-allocation file
creation. This was added years ago because some customer of SGI
demanded that we still be able to create (empty?) files with zero
free blocks remaining so long as there were free inodes and space in
existing directory blocks. This came at an unacceptable risk of
ENOSPC'ing midway through a transaction and shutting down the fs, so
we're removing it for the create case having changed our minds 20
years later.
However, some tests fail as a result, so fix them to be more
flexible about not failing when a dir/file creation fails due to
ENOSPC.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Try to draw a multiline rectangular outline in a file name and xattr
name, just to see if we can.
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>
In the final version of the xfs_io scrub command we don't allow the
probe function to have any parameters, so fix the helper to abide
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>
Modern gdbm-devel packages bundle together gdbm.h and ndbm.h. The
old m4 macro had detection support for some old gdbm libraries but
not for new ones.
We fix compilation of src/dbtest.c by making the autoconf helper
check for this new arrangement:
If both gdbm.h and ndbm.h are found define set both gdbm_ndbm_=true,
and have_db=true, and define HAVE_GDBM_H. The src/dbtest.c already
had a HAVE_GDBM_H but there was never a respective autoconf settter
for it. We can just re-use this and fix it for new arrangement.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Other generic tests that test dedupe all have 'dedupe' group except
generic/304. Add 304 to dedupe group too.
[eguan: add commit log]
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Fiemap gained support for passing in optional offset len which
denote the range requested, so this patch adds testcases for this
functionality. Aditionally, a special "ranged" argument is added to
the require_xfs_io_command which checks for the presence of fiemap
range support.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Getting an error midway through a direct write would return an error
and the error-code is returned in the write() call. However, partial
data is over-written during the call.
This tests simulates the ENOSPC error to check for partial direct
write consistency.
[eguan: use $AWK_PROG instead of bare awk]
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Tests the RWF_NOWAIT flag so the I/O returns immediately with
-EAGAIN on a new file since it requires block allocation.
It creates a file, syncs it, and overwrites the file with
RWF_NOWAIT. This should succeed.
Finally, read the contents to make sure the overwrite is successful.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
There are some parameters added with xfs_io. Check if the pwrite
parameters are available. For some cases, xfs_io now returns
"command -%c not supported", so added "not supported" to count as
error.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When ext4 encryption is enabled, the directory entries are encrypted
so we need to create fewer directory entries to guarantee that they
will all fit in a single block.
Also, the encryption metadata takes up extended attribute room so we
can only add a single xattr to guarantee that the xattrs will fit in
the inode.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
In all of the places where we need check to see if mkfs.ext4 can
support a set of file system features, we also should be checking to
see if the kernel can support those file system features. So rename
_require_ext4_mkfs_feature to _require_scratch_ext4_feature, and
actually format the file system in $SCRATCH_DEV.
Also allow ext4/306 to run on systems where mke2fs doesn't support
the "64bit" option.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The 'Wlog_Error_String' string is defined to be 256 bytes in length,
but in two places we write into it with a format that contains a
string (wfile->w_file) that has length 1024. This can overflow
Wlog_Error_String, as we see in the new compiler warnings from gcc
7.2.1:
write_log.c:124:37: warning: ‘%s’ directive writing up to 1023 bytes into
a region of size 224 [-Wformat-overflow=]
"Could not open write_log - open(%s, %#o, %#o) failed: %s\n",
^~
Fix this by increasing the length of Wlog_Error_String to 1280
characters (1024 for wfile->w_file plus 256 for the rest of the
format string), and by using snprintf() instead of sprintf() so we
are sure we don't overflow.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>