XFS headers are supposed to be included in a certain order so that
inline functions actually compile correctly. For the most part the
shell feeds us the files in an order that works, but with the
addition of the xfs_dir2_dirblock_bytes function this doesn't always
work now. Therefore, explicitly #include the headers in the
required order.
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>
If kmemleak is enabled, scan and report memory leaks after every
test.
Note that the kmemleak check support is EXPERIMENTAL! Due to the way
kmemleak works, the leak might be from an earlier test, or something
totally unrelated.
[eguan: add EXPERIMENTAL disclaimer in commit log 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>
Add tests to verify Ext4 online resizing feature with bigalloc
feature enabled. We test various resizing scenarios with different
cluster sizes.
Signed-off-by: Harshad Shirwadkar <harshads@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
open_by_handle can now store and load file handles from a file:
usage:
open_by_handle -p -o <handles_file> <test_dir> [N]
open_by_handle -p -i <handles_file> <test_dir> [N]
Add a new generic/exportfs test to use these new options to test
decoding file handles after cycle mount and after directory renames.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Without -r flag file handles are opened, but file content is not
read. Treat dir file hanldes, similarly. without -r flag, open dir
file handle, but don't verify its content.
This is going to be used by tests for which dir content is changed
between encode and decode of dir file handle.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
sys/signal.h is wrong and should not be used. Musl C library warns
about it.
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
strsignal(3) says that strsignal() should be used instead of
sys_siglist[].
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Remove unnecessary htonll() macro definition.
Macros and functions starting with two underscores are usually
internal and shouldn't be used by applications when a version
without "__" is available.
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
SIGCLD is synonymous with SIGCHLD, but the former is non-standard
and not supported by some C libraries such as musl.
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Integer types such as __uint32_t are non-standard and not supported
by some C libraries such as musl. This commit replaces them with
standard types such as uint32_t and includes stdint.h header where
necessary.
The following command was used to do the changing of types:
sed -r -i 's/__(u?int[0-9]{2}_t)/\1/g' src/*.c ltp/*.c
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
In musl C library headers ptrdiff_t is only defined in stddef.h.
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Running ./check with -n will not execute tests, however
when exclude files are used we still show them as if
they are run. Test the exclude file prior to assuming
we can run a test on a dry run.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Move the expunge test into a helper.
[eguan: make TEST_ID local and use grep -q not io redirection]
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
If log stripe unit isn't a multiple of the fs blocksize and
mounting, the invalid sb_logsunit leads to crash as soon as we try
to write to the log.
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>
1) Introduce _require_no_xfs_bug_on_assert helper to check if XFS is
built with CONFIG_XFS_ASSERT_FATAL, and call _require_no_xfs_debug
if bug_on_assert is not available.
2) Apply _require_no_xfs_bug_on_assert in xfs/098 and xfs/115.
3) Move filter_xfs_dmesg from xfs/098 to common/filter, and rename
it as _filter_assert_dmesg.
[eguan: update comment and _notrun message a bit]
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>
Fixes direct invocations of xfs_repair to add in -r option if required.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Richard Wareing <rwareing@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
To better exercise the data path code of realtime subvolumes, we
will set rtinherit=1 during mkfs calls. For tests which this is not
desired we introduce a _require_no_rtinherit function to opt out of
this behavior.
Signed-off-by: Richard Wareing <rwareing@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Some tests do not play well with realtime devices, in an effort to
produce a stable set of test which exercise the realtime code paths
we introduce a _require_no_realtime function to allow tests to opt
out of realtime subvolume test runs.
And to make tests generic/409-411 work well with rt device, teach
_get_mount now honors $SCRATCH_OPTIONS.
Signed-off-by: Richard Wareing <rwareing@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
generic/347 currently fails when run in conjunction with the DAX
mount option:
generic/347 72s ... - output mismatch (see
/root/project/xfstests/results//generic/347.out.bad)
--- tests/generic/347.out 2016-05-12 11:56:32.086618744 -0600
+++ /root/project/xfstests/results//generic/347.out.bad 2018-01-17
16:04:33.459348448 -0700
@@ -1,2 +1,3 @@
QA output created by 347
+mount: /mnt/xfstests_scratch: can't read superblock on
/dev/mapper/thin-vol.
=== completed
...
(Run 'diff -u tests/generic/347.out
/root/project/xfstests/results//generic/347.out.bad' to see the entire
diff)
This is expected because the dm-thin target currently lacks DAX
support.
Just skip this test if we are using DAX.
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>
Make sure _scratch_xfs_set_metadata_field() can be used on an
old xfsprogs-dev(e.g. v3.1.1).
The "-d" option was introduced since xfsprogs-dev v4.7.0 by commit
86769b3 ("xfs_db: allow recalculating CRCs on invalid metadata").
The special argument "--" is only used to end option-scanning
in getopt(). getopt() was introduced since xfsprogs-dev v3.2.3 by
commit c9f5e3d ("xfs_db: Allow writes of corrupted data")'.
Signed-off-by: xiao yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
shared/272 fails with kernels v4.15-rc1 and beyond when you are
mounted with DAX:
shared/272 [failed, exit status 1] - output mismatch (see
/root/project/xfstests/results//shared/272.out.bad)
--- tests/shared/272.out 2015-12-05 13:12:17.038257578 -0700
+++ /root/project/xfstests/results//shared/272.out.bad 2018-01-17
15:37:18.581631116 -0700
@@ -1,3 +1,3 @@
QA output created by 272
Switch data journalling mode. Silence is golden.
-Check filesystem
+/usr/bin/chattr: Device or resource busy while setting flags on
/mnt/xfstests_scratch/file.1
...
(Run 'diff -u tests/shared/272.out
/root/project/xfstests/results//shared/272.out.bad' to see the entire
diff)
This is expected. The following kernel commit:
commit e9072d859df3 ("ext4: prevent data corruption with journaling + DAX")
makes "chattr +j", which is attempting to turn on data journaling,
return -EBUSY if the ext4 DAX mount option is in use. This was done
to prevent the data corruption shown in xfstest ext4/030, added by
this xfstests commit:
commit 750a24e99e ("ext4: test for DAX + journaling corruption")
So, just skip shared/272 if the DAX mount option is in use.
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>
This test, btrfs/027, runs tests against different raid profiles in
a loop, if one of them aborts, it also fails the following ones with
errors like,
Test -m raid10 -d raid10
ERROR: /dev/xxx is mounted
Test -m raid5 -d raid5
ERROR: /dev/xxx is mounted
Test -m raid6 -d raid6
ERROR: /dev/xxx is mounted
_scratch_unmount is added to avoid the above.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
btrfs/011 replaces the first device in SCRATCH_DEV_POOL in test,
which is SCRATCH_DEV, and it fails to umount SCRATCH_MNT when it
aborts, because _cleanup doesn't do any umount. This may leave
SCRATCH_DEV not used but other devices from SCRATCH_DEV_POOL still
mounted on SCRATCH_MNT. Then this results in SCRATCH_DEV unusable
for subsequent tests because _require_scratch couldn't umount detect
& umount SCRATCH_DEV correctly.
Fix it by umounting SCRATCH_MNT in _cleanup, so the test always
umounts the devices on exit.
[eguan: add comments and rewrite summary and commit log]
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Tested-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit adds support for the 9p network file system, which is mainly
used by QEMU for sharing a file system from the host to the guest VM.
To run xfstests on it, launch QEMU with e.g.:
-virtfs local,path=$TMPDIR/p9-test,security_model=mapped-xattr,mount_tag=p9-test
-virtfs local,path=$TMPDIR/p9-scratch,security_model=mapped-xattr,mount_tag=p9-scratch
and inside the VM run xfstests with:
export TEST_DEV=p9-test
export SCRATCH_DEV=p9-scratch
export PLAN9_MOUNT_OPTIONS="-o trans=virtio,version=9p2000.L,cache=loose,posixacl"
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>