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>
This test has been failing for btrfs for quite some time, at least
since 4.7. There are 2 implementation details of btrfs that it
exposes:
1. Currently btrfs filesystem under 100mb are created in Mixed block
group mode. Freespace accounting for it is not 100% accurate - I've
observed consistent 1mb discrepancy between a newly created
filesystem, then writing a file and deleting it and checking the
free space.
2. BTRFS won't flush it's delayed allocation on file deletion if
less than 32mb are deleted. On such files we need to perform sync
(missing in the test) or wait until time elapses for transaction
commit.
In order to avoid both of the aforementioned idiosyncrasies of the
fs make the test filesystem 101mb. With this we achieve 2 things:
1. Since the filesystem is larger we can create a file larger than
32mb, so it's going to be flushed upon deletion and numbers acquired
from df will be accurate
2. We don't create the filesystem in mixed mode and also since the
1mb is less than %1 of 101mb we will fall within the tolerance of 1%
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Some test cases (AFAIK, btrfs RAID recovery test cases) read out
certain location to verify its data.
Such read is mostly OK, but the golden output contains the on-disk
offset, which can differ due to underlying chunk change. (This time
is mkfs chunk layout change for btrfs)
So introduce macro _filter_xfs_io_offset to filter out the offset part
wrote 65536/65536 bytes at offset 136708096
^^^^^^^^^^^^^^^^^^^^
And offset from "pread -v"
08260000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
^^^^^^^^^
Only btrfs/14[0-3] are affected.
Reported-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When the first writeback and the retried writeback of dquota buffer
get the same IO error, XFS will let xfsaild to restart the writeback
and xfs_qm_dqflush_done() will not be invoked. xfsaild will try to
re-push the quota log item in AIL, the push will return early
everytime after checking xfs_dqflock_nowait(), and xfsaild will try
to push it again.
IOWs, AIL will never be empty, and the umount process will wait for
the drain of AIL, so the umount process hangs.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
It's common to get and set the values of fields in XFS super block,
so factor them out as scratch_xfs_[get|set]_sb_field, reimplement
them based on _scratch_xfs_[get|set]_metadata_field, and update the
related test cases accordingly.
Also move _scratch_xfs_[get|set]_metadata_field from common/fuzzy to
common/xfs.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add _require_flakey_with_error_writes() to check the availability of
dm-flakey target and its error_writes feature, and support for
enabling FLAKEY_TABLE_ERROR table by passing FLAKEY_ERROR_WRITES to
_load_flakey_table().
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
dm-flakey can be used to emulate IO write error, however, when we
also need to prevent the IO error for a specific range of the block
device (eg., the log region of a XFS), we need to specify multiple
dm targets for the dm device.
Option --table can not accommodate the multiple dm targets case, so
let dmsetup get the possible-multiple-targets table from standard
input.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Modify _require_odirect() to skip O_DIRECT tests if the ext4 mount
option data=journal has been applied. Because ext4 disables its
O_DIRECT support when in data journaling mode, no significant value
is obtained by running these tests and they consume a significant
amount of run time. Additionally, this change eliminates the need
to triage false negative O_DIRECT test results caused by test
problems, as has occurred from time to time.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Currently generic shutdown tests are enabled on overlayfs by
extending _require_scratch_shutdown() to check shutdown support for
overlayfs, some of those tests also call
_require_metadata_journaling() to inspect whether test filesystem
support metadata journaling or not, so need to extend
_require_metadata_journaling() as well to check metadata journaling
support for overlayfs in case shutdown tests run on uncommon
overlayfs setup and fail. For example, base filesystem of overlayfs
is ext2 or ext4 with noload mode.
Metadata journaling check is based on base filesystem configurations
and because -overlay option saves those configurations to
OVL_BASE_*, adding restore/override the configurations before/after
the check.
Tested ext2, xfs, ext4(load/no-load mode) as base filesystem of
overlayfs in single and multi section configurations.
[eguan: update _notrun message]
Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add a regression test for the following kernel commit:
ext4: prevent data corruption with inline data + DAX
The test passes either if we don't encounter corruption, or if
mounting with DAX + inline data fails. The latter is the way that
we prevent this issue in the kernel.
[eguan: add 'dax' group]
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>
Add a regression test for the following kernel commit:
ext4: prevent data corruption with journaling + DAX
The test passes if either we successfully compare the data between
the mmap with journaling turned on and the one with journaling
turned off, or if we fail the chattr command to turn on or off
journaling. The latter is how we prevent this issue in the kernel.
[eguan: add 'dax' group]
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>
In this test we use a fixed sequence of operations in fsstress to
create some number of files and dirs and then exercise
xfsdump/xfsrestore on them. Since clonerange/deduperange are not
supported on all xfs configurations, detect if they're in fsstress
and disable them so that we always execute exactly the same sequence
of operations no matter how the filesystem is configured.
[eguan: move it from xfs/068 to common/dump as Dave suggested]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Suggested-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This is to reproduce a bug of scrub, with which scrub is unable to
repair raid6 corruption as expected.
The kernel side fixes are
Btrfs: make raid6 rebuild retry more
Btrfs: fix scrub to repair raid6 corruption
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>
Let a lot of writes soak in with multithreaded fsstress to look for
bugs and other problems.
[eguan: remove '-v' option of fsstress and remove 'clone' group]
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>