xfstests-dev.git
4 years agoopen_by_handle: add -s option to sleep and keep files open by handle
Amir Goldstein [Thu, 29 Mar 2018 12:06:49 +0000 (15:06 +0300)]
open_by_handle: add -s option to sleep and keep files open by handle

This feature is needed for tests that need to open file by handle and
then perform operations while that file is open. This will be used by
an overlay test to keep disconnected dentries in dcache.

Usage: open_by_handle -s <test_dir>

On success, the program will run until it gets a terminating signal.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoopen_by_handle: add -n option to suppress drop caches
Amir Goldstein [Thu, 29 Mar 2018 12:06:48 +0000 (15:06 +0300)]
open_by_handle: add -n option to suppress drop caches

By default, open_by_handle drops inode and page caches before trying
to open by file handles. Add an option to suppress drop caches for
testing open by handle with warm caches.

Usage: open_by_handle -n <test_dir> [N]

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoopen_by_handle: make -h (help) a valid option
Amir Goldstein [Thu, 29 Mar 2018 12:06:47 +0000 (15:06 +0300)]
open_by_handle: make -h (help) a valid option

All this does is suppress the "illegal value" message.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/278: find sfdir inode field prefix
Darrick J. Wong [Fri, 23 Mar 2018 16:54:47 +0000 (09:54 -0700)]
xfs/278: find sfdir inode field prefix

Use the xfs set/get metadata field helpers to detect the correct sfdir
field name prefix on v4-v5 filesystems.  This enables us to test inode
link count corrections on a (deliberately) disconnected directory.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs: test agfl reset on bad list wrapping
Darrick J. Wong [Fri, 23 Mar 2018 16:54:41 +0000 (09:54 -0700)]
xfs: test agfl reset on bad list wrapping

From the kernel patch that this test examines ("xfs: detect agfl
count corruption and reset agfl"):

"The struct xfs_agfl v5 header was originally introduced with
unexpected padding that caused the AGFL to operate with one less
slot than intended. The header has since been packed, but the fix
left an incompatibility for users who upgrade from an old kernel
with the unpacked header to a newer kernel with the packed header
while the AGFL happens to wrap around the end. The newer kernel
recognizes one extra slot at the physical end of the AGFL that the
previous kernel did not. The new kernel will eventually attempt to
allocate a block from that slot, which contains invalid data, and
cause a crash.

"This condition can be detected by comparing the active range of the
AGFL to the count. While this detects a padding mismatch, it can
also trigger false positives for unrelated flcount corruption. Since
we cannot distinguish a size mismatch due to padding from unrelated
corruption, we can't trust the AGFL enough to simply repopulate the
empty slot.

"Instead, avoid unnecessarily complex detection logic and and use a
solution that can handle any form of flcount corruption that slips
through read verifiers: distrust the entire AGFL and reset it to an
empty state. Any valid blocks within the AGFL are intentionally
leaked. This requires xfs_repair to rectify (which was already
necessary based on the state the AGFL was found in). The reset
mitigates the side effect of the padding mismatch problem from a
filesystem crash to a free space accounting inconsistency."

This test exercises the reset code by mutating a fresh filesystem to
contain an agfl with various list configurations of correctly wrapped,
incorrectly wrapped, not wrapped, and actually corrupt free lists; then
checks the success of the reset operation by fragmenting the free space
btrees to exercise the agfl.  Kernels without this reset fix will shut
down the filesystem with corruption errors.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay/05[45]: Document the fix commit
Amir Goldstein [Sun, 25 Mar 2018 08:02:55 +0000 (11:02 +0300)]
overlay/05[45]: Document the fix commit

This fix was merged for v4.16-rc5.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/478: fix potential test blocking
Xiong Zhou [Fri, 23 Mar 2018 02:49:37 +0000 (10:49 +0800)]
generic/478: fix potential test blocking

Reduce semtimedop timeout to 5s, 15s is too long if something get
tangled up. Add retry counting to getlk routine, infinite loop is
dangerous. If something goes wrong unexpextedly, test is blocked and
wasting time.

Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/xfs: fix various problems with _supports_xfs_scrub
Darrick J. Wong [Thu, 22 Mar 2018 02:48:09 +0000 (19:48 -0700)]
common/xfs: fix various problems with _supports_xfs_scrub

The _supports_xfs_scrub helper is called with a mountpoint (a working
mountpoint is required for scrub) and a block device (used to detect
norecovery mounts).  If either of these conditions aren't satisfied we
should return failure status to the caller, not unilaterally decide to
bail out of the test.  In particular, the -b test doesn't work if the
fs has already shutdown on us.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/xfs: don't call xfs_scrub on a block device
Darrick J. Wong [Thu, 22 Mar 2018 02:46:56 +0000 (19:46 -0700)]
common/xfs: don't call xfs_scrub on a block device

xfs_scrub takes an xfs mountpoint as its argument, not a block
device. Therefore, fix _check_xfs_filesystem to call it correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobuild: fix <ndbm.h> detection in AC_PACKAGE_WANT_GDBM
Jeff Mahoney [Thu, 15 Mar 2018 21:54:55 +0000 (17:54 -0400)]
build: fix <ndbm.h> detection in AC_PACKAGE_WANT_GDBM

SUSE systems export the NDBM interface via /usr/include/ndbm.h

This means that dbtest wasn't built on SUSE systems until commit
2353022 (build: update AC_PACKAGE_WANT_GDBM() and src/dbtest.c to
build). That change was incompatible with older SLES releases due to
<ndbm.h> and <gdbm.h> both defining the datum type, resulting in
build failures.

Nothing has ever set HAVE_GDBM_H or checked for the <gdbm.h> header
prior to the above commit, and it's not required on SUSE systems
either, so just remove that entirely.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobuild: clean up AC_PACKAGE_WANT_GDBM
Jeff Mahoney [Thu, 15 Mar 2018 21:54:54 +0000 (17:54 -0400)]
build: clean up AC_PACKAGE_WANT_GDBM

The AC_PACKAGE_WANT_GDBM macro is not easily read. It's not doing
anything particularly complex other than working through a set of
alternatives for headers and libraries.

This patch cleans it up to be more readable.  We also only attempt
to check in libgdbm_compat if the checks in libgdbm fail.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobuild: AC_PACKAGE_WANT_GDBM, fall back to compat if libgdbm detection fails
Jeff Mahoney [Thu, 15 Mar 2018 21:54:53 +0000 (17:54 -0400)]
build: AC_PACKAGE_WANT_GDBM, fall back to compat if libgdbm detection fails

We currently check if libgdbm_compat contains the required symbols
even if libgdbm does. Let's fall back only when necessary (which is
pretty much always anyway).

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobuild: remove dead AC_PACKAGE_WANT_NDBM macro
Jeff Mahoney [Thu, 15 Mar 2018 21:54:52 +0000 (17:54 -0400)]
build: remove dead AC_PACKAGE_WANT_NDBM macro

Commit fb05a918085 build: remove IRIX-specific build logic) removed
the tests used on IRIX but missed AC_PACKAGE_WANT_NDBM.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/015: Issue sync after deleting the fillup file
Nikolay Borisov [Wed, 14 Mar 2018 14:48:37 +0000 (16:48 +0200)]
generic/015: Issue sync after deleting the fillup file

This test fails on btrfs due to the presence of delayed processing
of file deletes if the file is smaller than 32mb. Initially commit
97575acd7495b412435d06229a6d94ed9a814ada tried to fix a similar
failure by bumping the size of the filesystem. However that change
had a knock-on effect in that the scratch filesystem created is
larger than 100mb and thus not created in mixed mode. This in turn
causes the fs to have only 20mb for file data (rest is taken by DUP
metadata). Naturally, this leads to file freeing taking up to
"transaction commit interval" (default 30 s) time to properly account
the freed space.

Not standards define when unlink operations should be accounted so
btrfs is well within its right to be implemented in that way. So
to avoid this edge case just issue a sync before taking the 2nd
free space reading.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay: Absolute redirect should be followed even if ancestor is opaque
Vivek Goyal [Wed, 14 Mar 2018 13:16:18 +0000 (09:16 -0400)]
overlay: Absolute redirect should be followed even if ancestor is opaque

Typically, when following absolute redirect, if an opauqe dentry is
found, lookup in further lower directories is stopped. But if a child
dentry has another absolute redirect, then lookup in further lower
layers should continue.

Say, following is example setup.
upper:  /redirect (redirect=/a/b/c)
lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
lower0: /a/b/d/foo

"redirect" directory in upper should merge with lower1:/a/b/c/ and
lower0:/a/b/d/, despite lower1:/a/b/ being opaque.

This example and kernel fix has come from Amir Goldstein. I am just
putting a test for it to make sure its not broken down the line.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: test on creating new file after log replay
Liu Bo [Sat, 10 Mar 2018 23:56:04 +0000 (16:56 -0700)]
generic: test on creating new file after log replay

The regression is introduced to btrfs in linux v4.4 and it refuses to
create new files after log replay by returning -EEXIST.

Although the problem is on btrfs only, there is no btrfs stuff in terms
of test, so this makes it generic.

The kernel fix is
  Btrfs: fix unexpected -EEXIST when creating new inode

[Eryu: add _require_metadata_journaling rule and 'log' 'metadata' group]

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/146: make sure hit all stripes in the case of compression
Lu Fengqi [Thu, 8 Mar 2018 08:30:53 +0000 (16:30 +0800)]
btrfs/146: make sure hit all stripes in the case of compression

In the case of compression, each 128K input data chunk will be
compressed to 4K (because of the characters written are duplicate).
Therefore we have to write (128K * 16) to make sure every stripe can be
hit.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/004: increase the buffer size of logical-resolve to the maximum value 64K
Lu Fengqi [Tue, 6 Mar 2018 07:02:31 +0000 (15:02 +0800)]
btrfs/004: increase the buffer size of logical-resolve to the maximum value 64K

Because of commit e76e13ce8c0b ("fsstress: implement the
clonerange/deduperange ioctls"), dedupe makes the number of references
to the same extent item increase so much that the default 4K buffer of
logical-resolve is no longer sufficient.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: test fsync new file after removing hard link
Filipe Manana [Wed, 28 Feb 2018 15:58:00 +0000 (15:58 +0000)]
generic: test fsync new file after removing hard link

Test that if we have a file with two hard links in the same parent
directory, then remove of the links, create a new file in the same
parent directory and with the name of the link removed, fsync the new
file and have a power loss, mounting the filesystem succeeds.

This test is motivated by a bug found in btrfs, which is fixed by
the linux kernel patch titled:

  "Btrfs: fix log replay failure after unlink and link combination"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: add test for fsync after renaming and linking special file
Filipe Manana [Wed, 28 Feb 2018 15:57:34 +0000 (15:57 +0000)]
generic: add test for fsync after renaming and linking special file

Test that when a fsync journal/log exists, if we rename a special file
(fifo, symbolic link or device), create a hard link for it with its old
name and then commit the journal/log, if a power loss happens the
filesystem will not fail to replay the journal/log when it is mounted
the next time.

This test is motivated by a bug found in btrfs, which is fixed by the
following patch for the linux kernel:

  "Btrfs: fix log replay failure after linking special file and fsync"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay: correct scratch dirs check
zhangyi (F) [Thu, 1 Mar 2018 12:13:47 +0000 (20:13 +0800)]
overlay: correct scratch dirs check

Tests that use _overlay_scratch_mount_dirs instead of _scratch_mount
should use _require_scratch_nocheck instead of _require_scratch
because these tests are either mounting with multiple lower dirs or
mounting with non-default lower/upper/work dir, so
_check_overlay_scratch_fs won't handle these cases correctly. So we
introduce _overlay_check_scratch_dirs helper and should call this
helper with the correct dir arguments for these non-default cases.

This patch modify these tests to optionally call
_overlay_check_scratch_dirs at the end of the test or after
_scratch_umount to mount base filesystem only and run the checker.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay: skip check for tests finished with corrupt filesystem
zhangyi (F) [Thu, 1 Mar 2018 12:13:46 +0000 (20:13 +0800)]
overlay: skip check for tests finished with corrupt filesystem

No post-test check of the overlay dirs is required if case leaves
corrupt filesystem after test. We shoud use _require_scratch_nocheck()
instead of _require_scratch() in these cases.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay/003: fix fs check failure
zhangyi (F) [Thu, 1 Mar 2018 12:13:45 +0000 (20:13 +0800)]
overlay/003: fix fs check failure

_check_overlay_scratch_fs() will check lowerdir of overlay filesystem,
this case remove this directory after test will lead to check failure,
and it is not really necessary to remove this directory, so keep this
directory.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay: hook filesystem check helper
zhangyi (F) [Thu, 1 Mar 2018 12:13:44 +0000 (20:13 +0800)]
overlay: hook filesystem check helper

Hook filesystem check helper to _check_test_fs and _check_scratch_fs
for checking consistency of underlying dirs of overlay filesystem.
These helpers works only if fsck.overlay exists.

This patch introduce OVERLAY_FSCK_OPTIONS use for check overlayfs like
OVERLAY_MOUNT_OPTIONS, and also introduce a mount point check helper in
common/rc to detect a dir is a mount point or not.

[ _check_test_fs/_check_scratch_fs part picked from Amir's patch, thanks ]

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/rc: improve dev mounted check helper
zhangyi (F) [Thu, 1 Mar 2018 12:13:43 +0000 (20:13 +0800)]
common/rc: improve dev mounted check helper

There is a problem of missing fstype check in _is_mounted() helper,
it will return the mountpoint if only the device arguments matches.

For example:
  Base mounted filesystem:
    /dev/sda2 on /boot type ext4 (rw,relatime,data=ordered)

  FSTYPE=xfs
  mountpoint=`_is_mounted /dev/sda1`
  echo "$mountpoint"

  Output: /boot

This patch rename _is_mounted to _is_dev_mounted because it check
the given device only (not mount dir), and add an optional "fstype"
parameter, let user specify file system type instead of default
FSTYPE. Finally, use findmnt instead of mount to avoid complex
processing of mount info and fix this problem simply.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsstress: avoid infinite loops in clonerange_f
Darrick J. Wong [Fri, 23 Feb 2018 16:22:24 +0000 (08:22 -0800)]
fsstress: avoid infinite loops in clonerange_f

Evidently ceph will report a 4M blocksize, which trips clonerange_f's
clumsy attempt to avoid reflinking an extent on top of itself.  The
original code assumed that "pick a random destination up to 1MB past the
end of the file" would suffice, but that clearly won't with a 4M
blocksize.  Instead, we'll change it to 1024*blksize.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Tested-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agogeneric/47[23]: remove from auto/quick groups
Dave Chinner [Fri, 23 Feb 2018 05:01:12 +0000 (16:01 +1100)]
generic/47[23]: remove from auto/quick groups

generic/472 is for changes that are not upstream and seem dead in
the water at the moment, so remove this test from the auto and quick
groups until it's been resolved upstream and the changes merged.

generic/473 really doesn't seme useful. FIEMAP is a debugging
interface, xfs_io is a debugging tool and so trying to make every
filesytem report exactly the same thing for a ranged query just
strikes me as the wrong thing to be doing. This fails on XFS, and
there's no apparent resolution to that in sight, so remove the test
from the auto and quick, too.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agocommon/xfs: Initialise OPTIND for getopts calls
Dave Chinner [Fri, 23 Feb 2018 03:54:54 +0000 (14:54 +1100)]
common/xfs: Initialise OPTIND for getopts calls

According to the bash man page:

OPTIND is initialized to 1 each time the shell or a shell
script is invoked.

This doesn't appear to be true - in tests scripts with no other
getopts calls, I'm seeing the getopts loop in _xfs_check to fail to
parse input parameters correctly. Tracing shows the parameters are
being passed to _xfs_check correctly, but on occassion getopts
simply doesn't see them.

Hence when running tests with both external log and real time
devices, tests are failing at random because xfs_check is
mis-parsing the parameters passed to it and not configuring the
external log correctly:

_check_xfs_filesystem: filesystem on /dev/sdg is inconsistent (c)
*** xfs_check output ***
aborting - no external log specified for FS with an external log
*** end xfs_check output

Fix this by ensuring OPTIND is correctly initialised before using
getopts. Do it for all places that call getopts that don't already
set OPTIND=1 before starting their parsing loop.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agocommon/rc: Fix fcollapse require code to work with 64k block size
Chandan Rajendra [Thu, 22 Feb 2018 05:58:55 +0000 (11:28 +0530)]
common/rc: Fix fcollapse require code to work with 64k block size

For 64k block size, the require code fails because the block range
[4k, 12k] would cause the fcollapse syscall to return -EINVAL. Hence
the tests using them are not executed.

This commit fixes the issue by calculating file offset ranges based
on the block size of the underlying filesystem.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agofsx: Fix -P errors
Andreas Gruenbacher [Wed, 21 Feb 2018 10:55:20 +0000 (11:55 +0100)]
fsx: Fix -P errors

When -P is used, report the correct *.fsxgood filename in
report_failure and fix the default *.fsxops filename.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agofstests: _fail test by default when _scratch_mount fails
Eryu Guan [Wed, 7 Feb 2018 09:31:36 +0000 (17:31 +0800)]
fstests: _fail test by default when _scratch_mount fails

Previously _scratch_mount didn't check the mount status and most
tests continue to run even if the mount failed (unless test checks
for the mount status explicitly). This would result in running tests
on the underlying filesystem (usually rootfs) and implicit test
failures, and such failures can be annoying and are usually hard to
debug.

Now _fail test by default if _scratch_mount failed and introduce
_try_scratch_mount for tests that need to check mount results
themselves.

Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agogeneric/25[02]: increase filesystem size
Dave Chinner [Thu, 22 Feb 2018 00:32:03 +0000 (11:32 +1100)]
generic/25[02]: increase filesystem size

On reflink+rmapbt XFs filesystems there isn't enough free space to
run this test on the 64MB filesystem image created. It notruns with
a curious error message - needs at least 0GB free:

generic/250             [10:01:57] [10:01:58] [not run]
        generic/250 -- This test requires at least 0GB free on /mnt/scratch to run

Fix this by increasing the size of the base filesystem image.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agobtrfs/150: add _scratch_dev_pool_get/put to run the test as expected
Misono, Tomohiro [Tue, 20 Feb 2018 05:34:32 +0000 (14:34 +0900)]
btrfs/150: add _scratch_dev_pool_get/put to run the test as expected

btrfs/150 uses RAID1 profile and make SCRATCH_DEV fail for test.
However, if SCRATCH_DEV_POOL consists more than two devices,
SCRATCH_DEV may not be used for RAID1 pair and the tests may not run
as expected.

Fix this by add _scratch_dev_pool_get/put like other tests (141, 143
etc.) do.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agoxfs/015: enlarge the initial fs size
Eryu Guan [Thu, 4 Jan 2018 05:46:26 +0000 (13:46 +0800)]
xfs/015: enlarge the initial fs size

Kernel commit f59cf5c29919 ("xfs: remove "no-allocation"
reservations for file creations") is known to cause earlier ENOSPC
conditions, and xfs/015 is affected in the way that no new file/dir
can be created in a newly created 16M XFS with both reflink and
rmapbt enabled, thus xfs/015 fails due to the missing test dirs.

So enlarge the initial fs size to 32M that we're able to create new
dir/file before growing the filesystem size.

Note that we doubled the fs initial size, we need to double the
required space too.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agogeneric: add OFD lock tests
Xiong Zhou [Tue, 13 Feb 2018 14:10:26 +0000 (22:10 +0800)]
generic: add OFD lock tests

Test OFD locks. Use fcntl F_OFD_SETLK/F_OFD_GETLK, to verify we are
being given correct advices through getlk by kernel.

The basic idea is one setlk routine setting locks via fcntl *_SETLK,
followed by operations like clone, dup then close fd; another
routine getlk getting locks via fcntl *_GETLK.

Firstly in setlk routine process P0, place a lock L0 on an opened
testfile, then do clone or dup and close relative fd.

In getlk process P2, do fcntl *_GETLK with lock L1 after get
notified by setlk routine.

In the end, getlk routine check the returned struct flock.l_type to
see if the lock mechanism works fine.

Test combainations of:
- shared or exclusive lock
- these locks are conflicting or not
- one OFD lock and one POSIX lock
- that open testfile RDONLY or RDWR
- clone with CLONE_FILES or not
- dup and close newfd

[eguan: made some minor non-functional changes]

Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agoxfs: rmapbt swapext block reservation overrun test
Brian Foster [Thu, 8 Feb 2018 16:04:29 +0000 (11:04 -0500)]
xfs: rmapbt swapext block reservation overrun test

The XFS rmapbt extent swap mechanism performs an extent by extent
swap to ensure the rmapbt is rectified with the appropriate extent
owner information after the operation. This implementation suffers
from a corner case that requires extra reservation if the swap
operation results in bouncing one of the associated inodes between
extent and btree formats. When this corner case occurs, it results
in a transaction block reservation overrun and possible corruption
of the free space accounting.

This regression test provides coverage for this corner case. It
creates two files with a large enough extent count to require btree
format, regardless of inode size, and performs a sequence of extent
swaps between them with a decreasing extent count until all extents
are removed from the file(s). This ensures that one of the swaps
covers the btree <-> extent fork format boundary case.

This test reproduces fs corruption on rmapbt enabled filesystems
running on kernels without the associated extent swap fix.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agoxfs: regression tests for reflink quota bugs
Darrick J. Wong [Wed, 7 Feb 2018 21:19:38 +0000 (13:19 -0800)]
xfs: regression tests for reflink quota bugs

Add three tests to look for quota bugs in xfs reflink. The first
test looks for problems when we have speculative cow reservations in
memory, we chown the file, but the reservations don't move to the
new owner.  The second test checks that we remembered to dqattach
the inodes before performing reflink operations. The third is a
stress test for reflink quota handling near enospc and helped us to
find a directio cow write corruption bug when free space is
fragmented.

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>
4 years agoxfs/348: dir->symlink corruption must not be allowed
Darrick J. Wong [Wed, 7 Feb 2018 21:19:45 +0000 (13:19 -0800)]
xfs/348: dir->symlink corruption must not be allowed

A directory corrupted into a symlink is caught by the local format
ifork verifiers, and previously this test failed to catch such
kernel bug, so fix the test.

Note that the local format ifork verifiers were introduced by commit
0795e004fd4f ("xfs: create structure verifier function for short
form symlinks"), and didn't get wired up until commit 9cfb9b47479e
("xfs: provide a centralized method for verifying inline fork
data").

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>
4 years agoxfs_scrub: remove -y parameter
Darrick J. Wong [Wed, 7 Feb 2018 21:19:24 +0000 (13:19 -0800)]
xfs_scrub: remove -y parameter

Remove the -y parameter from scrub runs since we're removing that
option from xfs_scrub.

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>
4 years agooverlay: renumber tests after merge
Eryu Guan [Thu, 8 Feb 2018 12:18:31 +0000 (20:18 +0800)]
overlay: renumber tests after merge

Tests were merged with high seq numbers to avoid conflicts with
other tests.  Now renumber them to contiguous numbers, as all other
tests have been merged correctly. This is easier to do than
assigning the final seq numbers at commit time.

Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: add fsck.overlay impure xattr test
zhangyi (F) [Thu, 8 Feb 2018 03:19:13 +0000 (11:19 +0800)]
overlay: add fsck.overlay impure xattr test

Add fsck.overlay test case to test it how to deal with impure xattr
in underlying directories of overlayfs.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: add fsck.overlay redirect directory test
zhangyi (F) [Thu, 8 Feb 2018 03:19:12 +0000 (11:19 +0800)]
overlay: add fsck.overlay redirect directory test

Add fsck.overlay test case to test it how to deal with invalid/valid/
duplicate redirect xattr in underlying directories of overlayfs.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: add fsck.overlay whiteout test
zhangyi (F) [Thu, 8 Feb 2018 03:19:11 +0000 (11:19 +0800)]
overlay: add fsck.overlay whiteout test

Add fsck.overlay test case to test it how to deal with orphan/valid
whiteouts in underlying directories of overlayfs.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: define common overlay xattr keys
zhangyi (F) [Thu, 8 Feb 2018 03:19:10 +0000 (11:19 +0800)]
overlay: define common overlay xattr keys

Define common overlay xattr keys from Linux kernel for ovl tests use.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: add filesystem check helper
zhangyi (F) [Thu, 8 Feb 2018 03:19:09 +0000 (11:19 +0800)]
overlay: add filesystem check helper

Add filesystem check helper for the upcoming fsck.overlay utility.
This helper invoke fsck.overlay to check and optionally repair
underlying directories of overlay filesystem.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agogeneric/270: Check for scratch mount success
Andreas Gruenbacher [Sat, 3 Feb 2018 18:57:37 +0000 (19:57 +0100)]
generic/270: Check for scratch mount success

We don't want to fill up the scratch mount point if the scratch
mount fails.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agocheck: Fix exit status
Andreas Gruenbacher [Sat, 3 Feb 2018 18:57:35 +0000 (19:57 +0100)]
check: Fix exit status

Exit with status 1 if there were any failures: using the number of
failed tests as the exit status makes no sense and can easily
overwrap.

In addition, clean up a few minor things.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: test overlay file handle of dir with ancestor under lower redirect
Amir Goldstein [Wed, 31 Jan 2018 11:44:55 +0000 (13:44 +0200)]
overlay: test overlay file handle of dir with ancestor under lower redirect

Overlayfs with nfs_export enabled, indexes all directories on copy
up.  Directory index is requires for decoding lower directory file
handles in case ancestors have been renamed.

When enabling nfs_export on an overlay that has merge dirs with
lower layer redirects, the possibility of ancestor rename requires
special handling when encoding lower directory file handles from
layer > 1.

- Check decode of lower dir with parent under lower redirect
- Check decode of lower dir with grandparent under lower redirect
- Check decode of lower dir after rename of lower redirected parent
- Check decode of lower dir after rename of lower redirected grandparent

This test requires and enables overlayfs NFS export support and
merge dir rename support (redirect_dir).
NFS export support depends on and requires overlayfs 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>
4 years agooverlay: test overlay file handles of lower dir with non-indexed ancestor
Amir Goldstein [Wed, 31 Jan 2018 11:44:54 +0000 (13:44 +0200)]
overlay: test overlay file handles of lower dir with non-indexed ancestor

Overlayfs with nfs_export enabled, indexes all directories on copy
up.  Directory index is requires for decoding lower directory file
handles in case ancestors have been renamed.

When enabling nfs_export on an overlay that already has non-indexed
merge dirs, the possibility of non-indexed ancestor rename requires
special handling when encoding lower directory file handles.

- Check encode/decode/read file handles of non-indexed merge dir
- Check encode/decode/read file handles of dir with non-indexed parent
- Check encode/decode/read file handles of dir with non-indexed grandparent
- Check decode/read of file handles after rename of non-indexed merge dir
- Check decode/read of file handles after rename of non-indexed parent
- Check decode/read of file handles after rename of non-indexed grandparent

This test requires and enables overlayfs NFS export support and
merge dir rename support (redirect_dir).
NFS export support depends on and requires overlayfs 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>
4 years agogeneric/{274,315}: Require falloc -k support
Rostislav Skudnov [Tue, 30 Jan 2018 13:54:59 +0000 (13:54 +0000)]
generic/{274,315}: Require falloc -k support

These test cases require filesystem support for FALLOC_FL_KEEP_SIZE
flag in fallocate().

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agogeneric/307: Require ACL support
Rostislav Skudnov [Tue, 30 Jan 2018 13:54:58 +0000 (13:54 +0000)]
generic/307: Require ACL support

Test checks ctime change on setfacl, which requires ACL support from
the underlying filesystem.

[eguan: add commit log and source common/attr]

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: test encode/decode of non-samefs overlay file handles with renames
Amir Goldstein [Tue, 30 Jan 2018 06:12:22 +0000 (08:12 +0200)]
overlay: test encode/decode of non-samefs overlay file handles with renames

This is a variant of overlay file handles with renames test for an
overlayfs that is composed of multiple lower layers not on the same
underlying fs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: test encode/decode overlay file handles with renames
Amir Goldstein [Tue, 30 Jan 2018 06:12:21 +0000 (08:12 +0200)]
overlay: test encode/decode overlay file handles with renames

- Check decode/read of file handles after rename of parent
- Check decode/read of file handles after rename of grandparent
- Check decode/read of file handles after move to new parent
- Check encode/decode/read of file handles in non-upper overlay

This test requires and enables overlayfs NFS export support and merge
dir rename support (redirect_dir).
NFS export support depends on and requires overlayfs index feature.

This test covers only encode/decode of file handles for overlayfs
configuration of all layers on the same base fs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: test encode/decode of non-samefs overlay file handles
Amir Goldstein [Tue, 30 Jan 2018 06:12:20 +0000 (08:12 +0200)]
overlay: test encode/decode of non-samefs overlay file handles

This is a variant of overlay file handles test for an overlayfs that
is composed of multiple lower layers not on the same underlying fs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: test encode/decode overlay file handles
Amir Goldstein [Tue, 30 Jan 2018 06:12:19 +0000 (08:12 +0200)]
overlay: test encode/decode overlay file handles

- Check encode/write/decode/read content of lower/upper file handles
- Check encode/decode/write/read content of lower/upper file handles
- Check decode/read of unlinked lower/upper files and directories
- Check decode/read of lower file handles after copy up, link and unlink

This test requires and enables overlayfs NFS export support. NFS
export support depends on and requires overlayfs index feature.

This test covers only encode/decode of file handles for overlayfs
configuration of all layers on the same base fs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agofstests: implement require of multiple overlayfs features
Amir Goldstein [Tue, 30 Jan 2018 06:12:18 +0000 (08:12 +0200)]
fstests: implement require of multiple overlayfs features

Some overlayfs features must be checked together, because they cannot
be enabled without a dependent feature (e.g. nfs_export and index).

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: add a test for multiple redirects to the same lower dir
Amir Goldstein [Sun, 28 Jan 2018 09:07:30 +0000 (11:07 +0200)]
overlay: add a test for multiple redirects to the same lower dir

Multiple redirects to the same lower dir will falsely return the
same st_ino/st_dev for two different upper dirs and will cause
'diff' to falsely report that content of directories is the same
when it is not.

This test checks that overalyfs detects and fails lookup of a
multiply redirected dir.

The check for multiply redirected dir was implemented by kernel
commit titled "ovl: hash directory inodes for fsnotify".

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay/017: require and enable redirect_dir
Amir Goldstein [Fri, 26 Jan 2018 07:59:08 +0000 (09:59 +0200)]
overlay/017: require and enable redirect_dir

This test renames a merge directory so it needs to enable
redirect_dir feature, which is not enabled by default.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay: consider index dir with whiteouts clean
Amir Goldstein [Fri, 26 Jan 2018 07:59:07 +0000 (09:59 +0200)]
overlay: consider index dir with whiteouts clean

Several tests check that index dir is empty after upper entries have
been unlinked. With nfs_export=on, index will contain a whiteout
index entry in that case so, allow chardevs when checking for clean
index dir.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agooverlay/036: fix upper/lower dir mismatch
Amir Goldstein [Fri, 26 Jan 2018 07:59:06 +0000 (09:59 +0200)]
overlay/036: fix upper/lower dir mismatch

Mount option index=on checks on mount that upper dir is not being
reused with a different lower dir than the first lower dir it was
mounted with. This behavior is verified by test overlay/037.

In this test however, it is not desired to fail mount on mismatch of
upper/lower, so use the matching upper/lower dirs in this test.

The mismatch went unnoticed because the index=off mounts do not
verify lower dir and the index=on mounts fails on EBUSY (dir in use
by another live mount) before failing on ESTALE (upper/lower dir
mismatch).

Never the less, fix the mismatch, so a change in the kernel between
the two sanity checks (EBUSY vs. ESTALE) won't break the test.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agoovelray: drop explicit use of OVERLAY_MOUNT_OPTIONS
Amir Goldstein [Fri, 26 Jan 2018 07:59:05 +0000 (09:59 +0200)]
ovelray: drop explicit use of OVERLAY_MOUNT_OPTIONS

Tests don't need to specify $OVERLAY_MOUNT_OPTIONS for overlay mount
helpers. These options have already been assigned to MOUNT_OPTIONS
by _overlay_config_override or by _mount_opts and will be added to
mount command by _common_dev_mount_options in _overlay_mount_dirs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agosrc/metaperf: Include linux/param.h explicitly for HZ macro
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:15 +0000 (15:57 +0000)]
src/metaperf: Include linux/param.h explicitly for HZ macro

Glibc includes linux/param.h when we include sys/param.h, whereas
musl libc does not do that. HZ is a Linux-specific macro, therefore
include the header file that defines it explicitly.

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agosrc/dmiperf: Include sys/types.h for u_int32_t
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:16 +0000 (15:57 +0000)]
src/dmiperf: Include sys/types.h for u_int32_t

u_int32_t type is defined in sys/types.h, which is often included by
glibc implicitly when some other headers are used, but other C
libraries such as musl may not necessarily do so, therefore an
explicit include is needed.

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agoxfs/24[356]: checking cow fork bmap requires CONFIG_XFS_DEBUG=y
Darrick J. Wong [Wed, 24 Jan 2018 23:53:41 +0000 (15:53 -0800)]
xfs/24[356]: checking cow fork bmap requires CONFIG_XFS_DEBUG=y

These tests requires XFS debugging functionality, so test for 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>
4 years agogeneric/403: don't spew '$GETFATTR_PROG: Killed' messages
Darrick J. Wong [Wed, 24 Jan 2018 23:53:35 +0000 (15:53 -0800)]
generic/403: don't spew '$GETFATTR_PROG: Killed' messages

Use a runfile presence check to control the background getfattr loop
instead of using kill -9.  This helps us to avoid the problem that
the controlling bash will print a process killed message, which
wrecks the golden output.

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>
4 years agoxfs/122: fix xfs header ordering problems
Darrick J. Wong [Wed, 24 Jan 2018 23:53:29 +0000 (15:53 -0800)]
xfs/122: fix xfs header ordering problems

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>
4 years agocommon/rc: report kmemleak errors
Darrick J. Wong [Wed, 24 Jan 2018 23:53:23 +0000 (15:53 -0800)]
common/rc: report kmemleak errors

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>
4 years agoext4: Ext4 online resize with bigalloc tests.
harshads [Wed, 24 Jan 2018 22:58:12 +0000 (14:58 -0800)]
ext4: Ext4 online resize with bigalloc tests.

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>
4 years agogeneric: test decoding file handles after cycle mount
Amir Goldstein [Tue, 23 Jan 2018 20:59:08 +0000 (22:59 +0200)]
generic: test decoding file handles after cycle mount

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>
4 years agogeneric/exportfs: golden output is not silent
Amir Goldstein [Tue, 23 Jan 2018 20:59:07 +0000 (22:59 +0200)]
generic/exportfs: golden output is not silent

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
4 years agosrc/open_by_handle: verify dir content only with -r flag
Amir Goldstein [Tue, 23 Jan 2018 20:59:06 +0000 (22:59 +0200)]
src/open_by_handle: verify dir content only with -r flag

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>
4 years agosrc/pwrite_mmap_blocked: Include signal.h instead of sys/signal.h
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:19 +0000 (15:57 +0000)]
src/pwrite_mmap_blocked: Include signal.h instead of sys/signal.h

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>
4 years agosrc/t_mtab: Replace sys_siglist[] with strsignal()
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:18 +0000 (15:57 +0000)]
src/t_mtab: Replace sys_siglist[] with strsignal()

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>
4 years agosrc/fssum: Use htobe64() instead of a custom macro
Rostislav Skudnov [Tue, 23 Jan 2018 08:08:18 +0000 (08:08 +0000)]
src/fssum: Use htobe64() instead of a custom macro

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>
4 years agodoio, growfiles: Use standard signal name SIGCHLD instead of SIGCLD
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:14 +0000 (15:57 +0000)]
doio, growfiles: Use standard signal name SIGCHLD instead of SIGCLD

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>
4 years agofstests: Replace all __[u]intNN_t types with standard [u]intNN_t
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:13 +0000 (15:57 +0000)]
fstests: Replace all __[u]intNN_t types with standard [u]intNN_t

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>
4 years agofsstress: Include stddef.h for ptrdiff_t
Rostislav Skudnov [Mon, 22 Jan 2018 15:57:12 +0000 (15:57 +0000)]
fsstress: Include stddef.h for ptrdiff_t

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>
4 years agocheck: expunge tests when doing a dry run
Luis R. Rodriguez [Sun, 21 Jan 2018 07:24:01 +0000 (23:24 -0800)]
check: expunge tests when doing a dry run

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>
4 years agocheck: move expunge test into a helper
Luis R. Rodriguez [Sun, 21 Jan 2018 07:24:00 +0000 (23:24 -0800)]
check: move expunge test into a helper

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>
4 years agoxfs: Regression test for invalid sb_logsunit
xiao yang [Fri, 19 Jan 2018 05:38:06 +0000 (13:38 +0800)]
xfs: Regression test for invalid sb_logsunit

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>
4 years agocommon: Add _require_no_xfs_bug_on_assert and factor out filter_xfs_dmesg
xiao yang [Fri, 19 Jan 2018 05:38:05 +0000 (13:38 +0800)]
common: Add _require_no_xfs_bug_on_assert and factor out filter_xfs_dmesg

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>
4 years agoxfs/realtime: Fix direct invocations of xfs_repair
Richard Wareing [Fri, 12 Jan 2018 04:16:19 +0000 (20:16 -0800)]
xfs/realtime: Fix direct invocations of xfs_repair

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>
4 years agoxfs/realtime: add _require_no_rtinherit function
Richard Wareing [Fri, 12 Jan 2018 04:16:18 +0000 (20:16 -0800)]
xfs/realtime: add _require_no_rtinherit function

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>
4 years agoxfs/realtime: Add require_no_realtime function
Richard Wareing [Fri, 12 Jan 2018 04:16:17 +0000 (20:16 -0800)]
xfs/realtime: Add require_no_realtime function

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>
4 years agocommon/dmthin: dm-thin lacks DAX support
Ross Zwisler [Thu, 18 Jan 2018 16:07:37 +0000 (09:07 -0700)]
common/dmthin: dm-thin lacks DAX support

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>
4 years agocommon/xfs: Check if write supports [-c|-d] option in xfs_db
xiao yang [Tue, 16 Jan 2018 07:26:55 +0000 (15:26 +0800)]
common/xfs: Check if write supports [-c|-d] option in xfs_db

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>
4 years agoshared/272: don't use data journaling with DAX
Ross Zwisler [Wed, 17 Jan 2018 23:23:50 +0000 (16:23 -0700)]
shared/272: don't use data journaling with DAX

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 750a24e99e48 ("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>
4 years agobtrfs/027: unmount scratch device if test fails
Liu Bo [Tue, 16 Jan 2018 20:10:18 +0000 (13:10 -0700)]
btrfs/027: unmount scratch device if test fails

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>
4 years agobtrfs/011: umount device in _cleanup
Liu Bo [Tue, 16 Jan 2018 20:10:17 +0000 (13:10 -0700)]
btrfs/011: umount device in _cleanup

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>
4 years agofstests: Add 9p network filesystem support
Tuomas Tynkkynen [Thu, 11 Jan 2018 14:05:43 +0000 (16:05 +0200)]
fstests: Add 9p network filesystem support

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>
4 years agogeneric/015: Change the test filesystem size to 101mb
Nikolay Borisov [Thu, 11 Jan 2018 09:17:47 +0000 (11:17 +0200)]
generic/015: Change the test filesystem size to 101mb

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>
4 years agofilter: Introduce filter to filter out offset for xfs_io
Qu Wenruo [Thu, 11 Jan 2018 08:01:11 +0000 (16:01 +0800)]
filter: Introduce filter to filter out offset for xfs_io

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>
4 years agoxfs: test for umount hang caused by the pending dquota log item in AIL
Hou Tao [Thu, 11 Jan 2018 06:49:32 +0000 (14:49 +0800)]
xfs: test for umount hang caused by the pending dquota log item in AIL

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>
4 years agocommon/rc: factor out _scratch_xfs_[get|set]_sb_field
Hou Tao [Thu, 11 Jan 2018 06:49:33 +0000 (14:49 +0800)]
common/rc: factor out _scratch_xfs_[get|set]_sb_field

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>
4 years agodmflakey: support error_writes feature for dm-flakey
Hou Tao [Thu, 11 Jan 2018 06:49:31 +0000 (14:49 +0800)]
dmflakey: support error_writes feature for dm-flakey

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>
4 years agodmflakey: support multiple dm targets for a dm-flakey device
Hou Tao [Thu, 11 Jan 2018 06:49:30 +0000 (14:49 +0800)]
dmflakey: support multiple dm targets for a dm-flakey device

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>
4 years agocommon/rc: ext4 doesn't support O_DIRECT with data journaling
Eric Whitney [Wed, 10 Jan 2018 21:19:05 +0000 (16:19 -0500)]
common/rc: ext4 doesn't support O_DIRECT with data journaling

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>
4 years agocommon/rc: perform _require_metadata_journaling check on overlay base fs
Chengguang Xu [Sat, 6 Jan 2018 08:23:58 +0000 (16:23 +0800)]
common/rc: perform _require_metadata_journaling check on overlay base fs

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>
4 years agoxfs: find libxfs api violations
Darrick J. Wong [Wed, 3 Jan 2018 19:22:00 +0000 (11:22 -0800)]
xfs: find libxfs api violations

New test to run tools/find-api-violations.sh in xfsprogs.

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>
4 years agoext4: test for inline data + DAX corruption
Ross Zwisler [Thu, 4 Jan 2018 08:11:21 +0000 (01:11 -0700)]
ext4: test for inline data + DAX corruption

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>