On ext2/ext3, it's expected that several single block metadata reads
can occur when writing to file in the same cgroup (the stack is like
below[1]). The purpose of the "write -> read/write" subtest is to
make sure the larger pwrite is accounted to the correct cgroup, not
necessarily enforce that zero bytes are read in service of the
write. This patch fixes the sub-test in order to tolerate small
reads in 1st cgroup.
[1] Callchain of the read:
@ext3_read_bio[
submit_bio+1
submit_bh_wbc+365
ext4_read_bh+72
ext4_get_branch+201
ext4_ind_map_blocks+382
ext4_map_blocks+295
_ext4_get_block+170
__block_write_begin_int+328
ext4_write_begin+541
generic_perform_write+213
ext4_buffered_write_iter+167
new_sync_write+345
vfs_write+438
__x64_sys_pwrite64+140
do_syscall_64+51
entry_SYSCALL_64_after_hwframe+68
, 5793, 12]: 3
Signed-off-by: Boyang Xue <bxue@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The nfs_export feature was introduced since kernel v4.16-rc1 after
commit f168f1098dd9038 ("ovl: add support for "nfs_export"
configuration"). On old kernel, this case will result in infinite
loop because overlay mount failed because of unrecognized mount
options nfs_export=off.
In kernel documentation, overlay.rst said "the mount options
index=off,nfs_export=on are conflicting for a read-write mount and
will result in an error.". So using single index=off is also ok in
here.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
When compile xfstest on old kernel, mount-idmapped.c will fail
because of missing linux/bpf.h. But this src file doesn't use bpf
realted functions or macros.
So remove these useless header files in idmapped-mounts.c and
mount-idmapped.c.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
We don't add fallback for renameat2, so it build failed on old
kernel. Also, renameat2() man-pages said as below:
"renameat2() has an additional flags argument. A renameat2() call
with a zero flags argument is equivalent to renameat()."
In this src file, we use zero flag for all renameat2 call. So we use
renameat directly.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by:Anju T Sudhakar<anju@linux.vnet.ibm.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
When compile them old gcc, get the following error
mount-idmapped.c: In function 'parse_map':
mount-idmapped.c:154:2: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 2; i++) {
Fix them by declaring them at the beggining instead of in loop.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Since xfstests commit 56908a2eb566c5("common/quota: move _qsetup()
helper to common code"), we have common _qsetup function. Even this
case doesn't use enforce value like xfs/050 and xfs/299, using
_qsetup is more meaningful. So remove useless qsetup.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Many test cases use xfs_io -c 'falloc' but forgot to add
_require_xfs_io_command "falloc". This will fail the test case if we
run the test case on a file system without fallcoate support e.g.
F2FS.
While we believe that normal fallocate(mode = 0) is always supported
on Linux, it is not true. Fallocate is disabled in several
implementations of zoned block support for file systems because the
pre-allocated region will break the sequential writing rule.
Currently, several test cases unconditionally call fallocate().
Let's add _require_xfs_io_command "falloc" to properly check the
feature is supported by a testing file system.
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Split each swap-file test into its own test. So on file-systems that
do not support e.g. sparse files (exfat) other swap-file tests can be
executed.
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Tested-by: Shreeya Patel <shreeya.patel@collabora.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
These two tests ensure we can store and retrieve timestamps on the
extremes of the date ranges supported by userspace, and the common
places where overflows can happen.
They differ from generic/402 in that they don't constrain the dates
tested to the range that the filesystem claims to support; we attempt
various things that /userspace/ can parse, and then check that the vfs
clamps and persists the values correctly.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Currently, the only functional testing for xfs_admin is xfs/287, which
checks that one can add 32-bit project ids to a V4 filesystem. This
obviously isn't an exhaustive test of all the CLI arguments, and
historically there have been xfs configurations that don't even work.
Therefore, introduce a couple of new tests -- one that will test the
simple options with the default configuration, and a second test that
steps a bit outside of the test run configuration to make sure that we
do the right thing for external devices. The second test already caught
a nasty bug in xfsprogs 5.11.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Make sure that the needsrepair feature flag can be cleared only by
repair and that mounts are prohibited when the feature is set.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Provide a mkfs helper to format the dm thin device when external devices
are in use, and fix the dmthin mount helper to support them. This fixes
regressions in generic/347 and generic/500 when external logs are in
use.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This test formats filesystems with various stripe alignments, then
checks that data file allocations are actually aligned to those stripe
geometries. If this test is run on an XFS filesystem with a realtime
volume and RTINHERIT is set on the root dir, the test will fail because
all new files will be created as realtime files, and realtime
allocations are not subject to data device stripe alignments. Fix this
by clearing rtinherit on the root dir.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Add helper functions that ensure that test is only executed on file
systems that implement chown, chmod and symbolic links.
Fixed test are: generic/{87,88,125,126,128,193,314,317,355,597,598}
[Eryu: remove _require_test and declare variable as local]
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Update the test so it can be run even for exfat which has 2 seconds
granularity for access_time and does not have a timestamp for
metadata change.
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
exfat does not support posix file permisions, so warning from mkswap is
inavitable. This patch hides the warning message so the test won't fail.
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Greatly increase the number of fs ops that fsstress is supposed to run
in in this test so that we can ensure that it's still running when the
quotaoff gets run. 1000 might have been sufficient in 2013, but it
isn't now.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
These two tests call various fallocate modes on a file and compare the
FIEMAP output to some golden output. Unfortunately, the golden output
doesn't take into account the possibility that (on XFS) the files could be
created on a realtime volume with a large rt extent size set.
Under such a configuration, fpunch operations that are aligned to the fs
block size but not the rt extent size simply result in those blocks
being set to unwritten status. Unfortunately, the test expects holes
and fails. Therefore, detect the situation and skip the tests.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
_require_scratch_16T_support does not itself check that the scratch
device exists, which means that it depends on someone else to call
_require_scratch. Document this dependency and fix this test so that we
can run:
./check --exact-order generic/374 generic/620
on an ext4 filesystem without g/620 tripping over the mess left by g/374
when it calls _notrun.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>