xfstests-dev.git
4 years agoxfs/191: update mkfs.xfs input results
Yang Xu [Fri, 27 Mar 2020 10:17:50 +0000 (18:17 +0800)]
xfs/191: update mkfs.xfs input results

When I run xfs/191 with upstream xfsprogs, I get the following
errors because mkfs.xfs binary has changed a lot(use loop device
to avoid stripe alignment affect).

-------------------------
pass -n size=2b /dev/loop0
pass -d agsize=8192b /dev/loop0
pass -d agsize=65536s /dev/loop0
pass -d su=0,sw=64 /dev/loop0
pass -d su=4096s,sw=64 /dev/loop0
pass -d su=4096b,sw=64 /dev/loop0
pass -l su=10b /dev/loop0
fail -n log=15 /dev/loop0
fail -r rtdev=/mnt/xfstests/test/191-input-validation.img /dev/loop0
fail -r size=65536,rtdev=/mnt/xfstests/test/191-input-validation.img /dev/loop0
fail -i log=10 /dev/loop
--------------------------

"pass -d su=0,sw=64 /dev/loop0", expect fail, this behavior has been
fixed by commit 16adcb88(mkfs: more sunit/swidth sanity checking).

"fail -n log=15 /dev/sda11" "fail -i log=10 /dev/sda11", expect pass,
this option has been removed since commit 2cf637c(mkfs: remove
logarithm based CLI option).

"fail -r size=65536,rtdev=$fsimg /dev/sda11" "fail -r rtdev=$fsimg
/dev/sda11" works well if we disable reflink, fail if we enable
reflink. It fails because reflink was not supported in realtime
devices since commit bfa66ec(mkfs: don't create realtime filesystems
with reflink enabled).

Since xfsprogs v4.15.0-rc1(commit 68344ba0f mkfs: introduce default
configuration structure), we have deault sectorsize and blocksize.
So some cases without 's' or 'b' suffix trun into pass.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: per-type quota timers set/get test
Zorro Lang [Sun, 29 Mar 2020 05:18:01 +0000 (13:18 +0800)]
generic: per-type quota timers set/get test

Set different grace time, make sure each of quota (user, group and
project) timers can be set (by setquota) and get (by repquota)
correctly.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/258: check filesystem support for negative timestamps
Luis Henriques [Wed, 4 Mar 2020 16:11:20 +0000 (16:11 +0000)]
generic/258: check filesystem support for negative timestamps

Some filesystems do not support negative c/m/atime timestamps. And
for these filesystems, generic/258 will fail.

Since there's currently no way to check sb->s_time_min from
userspace, this patch adds a new common/rc function
_require_negative_timestamps() that will _notrun depending on the
$FSTYP variable.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/587: fix rounding error in quota/stat block comparison
Darrick J. Wong [Wed, 18 Mar 2020 20:11:36 +0000 (13:11 -0700)]
generic/587: fix rounding error in quota/stat block comparison

It turns out that repquota (which reports in units of 1k blocks) reports
rounded up numbers when the fs blocksize is 512 bytes.  However, xfs_io
stat always reports block counts in units of 512 bytes.  If the number
of (512b) file blocks is not an even number, the "$3 / 2" expression
will round down, causing the test to fail.  Round up to the nearest 1k
to match repquota's behavior.

Reported-by: zlang@redhat.com
Fixes: 6b04ed05456fc6c ("generic: test unwritten extent conversion extent mapping quota accounting")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/310: slightly improve check for dmesg error
Paulo Alcantara (SUSE) [Tue, 17 Mar 2020 01:54:39 +0000 (22:54 -0300)]
generic/310: slightly improve check for dmesg error

The 'grep -c "error"' check was causing false positive results for
cifs.ko when running it with 'echo 1 > /proc/fs/cifs/cifsFYI'.

That is, the test would fail when cifs.ko prints out a non-error
message like this:

  [ 2320.903987] fs/cifs/smb2maperror.c: Mapping SMB2 status code 0x80000006 to POSIX err -61

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Suggested-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay/07[01]: use existing char/block devices
Amir Goldstein [Mon, 16 Mar 2020 18:53:20 +0000 (20:53 +0200)]
overlay/07[01]: use existing char/block devices

If the arbitrary char/block devices 1:1 do not exist in the system,
the tests fail.

Use /dev/zero and loop device instead of made up device numbers.

Reposted-by: Miklos Szeredi <miklos@szeredi.hu>
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 agobtrfs: test power fail after a ranged fsync when not using the no-holes feature
Filipe Manana [Fri, 6 Mar 2020 17:51:02 +0000 (17:51 +0000)]
btrfs: test power fail after a ranged fsync when not using the no-holes feature

Test a scenario were we fsync a range of a file and have a power
failure.  We want to check that after a power failure and mounting
the filesystem, we do not end up with a missing file extent
representing a hole. This applies only when not using the NO_HOLES
feature.

This currently fails on btrfs but it is fixed by a patch for the kernel
that has the following subject:

  "Btrfs: fix missing file extent item for hole after ranged fsync"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: Test subvolume delete --subvolid feature
Marcos Paulo de Souza [Mon, 9 Mar 2020 10:39:56 +0000 (07:39 -0300)]
btrfs: Test subvolume delete --subvolid feature

Now btrfs can delete subvolumes based in ther subvolume id. This
makes easy for the user willing to delete a subvolume that cannot be
accessed by the mount point, since btrfs allows to mount a specific
subvolume and hiding the other from the mount point.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/177: fix for nodesize 64K and type single
Anand Jain [Tue, 10 Mar 2020 04:22:32 +0000 (12:22 +0800)]
btrfs/177: fix for nodesize 64K and type single

In the blockgroup type single with nodesize 64K, the relocation of
the bg containing the swapfile is not being attempted during the
resize. So due to this the resize is successful and does not
generate the required 'Text file busy' error message as in the
golden output and so the testcase fails.

Fix this by replacing the mkfs created chunk with the bigger kernel
created chunk using balance, and then fill it up to the full. Upsize
to 3x of fssize once instead of first to 2G and then to 3G. Also
drop the unnecessary downsize to 2G step.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/177: check for minsize of the scratch device
Anand Jain [Tue, 10 Mar 2020 04:20:04 +0000 (21:20 -0700)]
btrfs/177: check for minsize of the scratch device

This test case needs at least 3g scratch device space, check for it
before starting the test case.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/513: fix allocsize on archs with pagesize larger than blocksize
Anthony Iliopoulos [Sat, 7 Mar 2020 10:54:57 +0000 (11:54 +0100)]
xfs/513: fix allocsize on archs with pagesize larger than blocksize

The minimum accepted allocsize mount option value is page size, which
causes the particular test to fail in architectures where page size >
block size. Fix it by basing the value on the platform page size rather
than the block size as obtained from mkfs. In addition add a filter so
that different values can be used without breaking the golden output.

Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsx: fix bug where zero range operations never use the keep size flag
Filipe Manana [Fri, 6 Mar 2020 12:35:17 +0000 (12:35 +0000)]
fsx: fix bug where zero range operations never use the keep size flag

We are never using the FALLOC_FL_KEEP_SIZE flag for zero range operations
even when we intend to use it. So fix it by setting that flag for the
call to fallocate(2) if the 'keep_size' parameter is true.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs: make sure xfs_db/xfs_quota commands are documented
Darrick J. Wong [Wed, 4 Mar 2020 02:46:47 +0000 (18:46 -0800)]
xfs: make sure xfs_db/xfs_quota commands are documented

Make sure all the xfs_db/xfs_quota commands are documented.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs: refactor calls to xfs_admin
Darrick J. Wong [Wed, 4 Mar 2020 02:46:40 +0000 (18:46 -0800)]
xfs: refactor calls to xfs_admin

Create a helper to run xfs_admin on the scratch device, then
refactor all tests to use it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/402: skip test if xfs_io can't parse the date value
Darrick J. Wong [Wed, 4 Mar 2020 02:46:34 +0000 (18:46 -0800)]
generic/402: skip test if xfs_io can't parse the date value

If xfs_io's utimes command cannot interpret the arguments that are
given to it, it will print out "Bad value for [am]time".  Detect
when this happens and drop the file out of the test entirely.

This is particularly noticeable on 32-bit platforms and the largest
timestamp seconds supported by the filesystem is INT_MAX.  In this
case, the maximum value we can cram into tv_sec is INT_MAX, and
there is no way to actually test setting a timestamp of INT_MAX + 1
to test the clamping.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: add test for large direct I/O w/ RAID
Omar Sandoval [Fri, 6 Mar 2020 01:03:12 +0000 (17:03 -0800)]
btrfs: add test for large direct I/O w/ RAID

Apparently we don't have any tests which exercise the code path in
Btrfs that has to split up direct I/Os for RAID stripes. Add one to
catch the bug fixed by "btrfs: fix RAID direct I/O reads with
alternate csums".

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofstests: transport two ext4 tests from LTP
Yong Sun [Thu, 27 Feb 2020 10:35:07 +0000 (18:35 +0800)]
fstests: transport two ext4 tests from LTP

Recently LTP upstream removed some ext4 tests[1].  And two of them
is still valid to keep. So I transport those two tests here.

ext4-nsec-timestamps, which is used to test nanosec timestamps of
ext4, rewrite into ext4/043 and 044.  ext4-subdir-limit, which is
used to test subdirectory limit of ext4, rewrite into ext4/045.

[1] https://marc.info/?l=linux-fsdevel&m=157190623919681&w=2

Signed-off-by: Sun Yong <yosun@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/300: modify test to work on any fs block size
Jeff Moyer [Thu, 20 Feb 2020 20:06:32 +0000 (15:06 -0500)]
xfs/300: modify test to work on any fs block size

The test currently assumes a file system block size of 4k.  It will
work just fine on any user-specified block size, though.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agosrc/t_mmap_collision: fix hard-coded page size
Jeff Moyer [Thu, 20 Feb 2020 20:06:31 +0000 (15:06 -0500)]
src/t_mmap_collision: fix hard-coded page size

Fix the test to run on non-4k page size systems.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agodax/dm: disable testing on devices that don't support dax
Jeff Moyer [Thu, 20 Feb 2020 20:06:30 +0000 (15:06 -0500)]
dax/dm: disable testing on devices that don't support dax

Move the check for dax from the individual target scripts into
_require_dm_target.  This fixes up a couple of missed tests that are
failing due to the lack of dax support (such as tests requiring
dm-snapshot).

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofstests: fix up filters & expected output for latest xfs_repair
Eric Sandeen [Fri, 28 Feb 2020 04:50:49 +0000 (20:50 -0800)]
fstests: fix up filters & expected output for latest xfs_repair

A handful of minor changes went into xfs_repair output in the
last push, so add a few more filters and change the resulting
expected output.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoext4/021: make sure the fdatasync subprocess exits
zhangyi (F) [Wed, 26 Feb 2020 03:22:56 +0000 (11:22 +0800)]
ext4/021: make sure the fdatasync subprocess exits

Now we just kill fdatasync_work process and wait nothing after the
test, so a busy unmount failure may appear if the fdatasync syscall
doesn't return in time.

  umount: /tmp/scratch: target is busy.
  mount: /tmp/scratch: /dev/sdb already mounted on /tmp/scratch.
  !!! failed to remount /dev/sdb on /tmp/scratch

This patch waits the xfs_io fdatasync subprocess exit to make sure
_check_scratch_fs success.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofstests: remove generic/484
Christoph Hellwig [Mon, 24 Feb 2020 22:29:26 +0000 (14:29 -0800)]
fstests: remove generic/484

Generic/484 tests functionality that isn't really related to file
systems, and has failed every since it was added.  Remove it as it
serves no puropse in xfstests.

[Eryu: also remove src/t_locks_execve.c and its entries in
src/Makefile and .gitignore]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofstests: add a another gap extent testcase for btrfs
Josef Bacik [Thu, 20 Feb 2020 14:38:55 +0000 (09:38 -0500)]
fstests: add a another gap extent testcase for btrfs

This is a testcase for a corner that I missed when trying to fix gap
extents for btrfs.  We would end up with gaps if we hole punched past
isize and then extended past the gap in a specific way.  This is a
simple reproducer to show the problem, and has been properly fixed by my
patches now.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: test newly supported cases of cloning inline extents
Filipe Manana [Wed, 19 Feb 2020 14:06:41 +0000 (14:06 +0000)]
btrfs: test newly supported cases of cloning inline extents

Test several scenarios of cloning operations where the source range
includes inline extents. They used to not be supported on btrfs
because their implementation was not straightforward, and therefore
these operations used to fail with errno EOPNOTSUPP on older
kernels.

This currently fails on any released kernel. It passes only when the
patch with the following subject is applied:

  "Btrfs: implement full reflink support for inline extents"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/112: remove some tests for cloning inline extents
Filipe Manana [Wed, 19 Feb 2020 14:06:27 +0000 (14:06 +0000)]
btrfs/112: remove some tests for cloning inline extents

This test case, btrfs/112, tests that some clone operations that have a
range covering inline extents fail with either -EOPNOTSUPP or -EINVAL.
These cases were unsupported on btrfs because they used to lead to file
corruptions and were not trivial to implement.

But there's now a patchset that adds support for them, and the relevant
patch of that patchset has the following subject:

  "Btrfs: implement full reflink support for inline extents"

So just remove these tests from test case btrfs/112, since this test
case is about testing only the unsupported reflink operations. A new
test case that verifies that these cases now work, as long as some other
new cases, will follow in another patch.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofstests: add an eio group
Theodore Ts'o [Fri, 21 Feb 2020 18:43:09 +0000 (13:43 -0500)]
fstests: add an eio group

This allows us to run all those tests which simulate disk failures
using dmerror.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/044: Remove useless _filter_logprint
Yang Xu [Thu, 20 Feb 2020 07:58:48 +0000 (15:58 +0800)]
xfs/044: Remove useless _filter_logprint

xfs/044 has customized  _filter_logprint function, but it was never
used. So remove it.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/029: filter out "extended-header: cycle: 1" from output
Yang Xu [Thu, 20 Feb 2020 07:58:47 +0000 (15:58 +0800)]
xfs/029: filter out "extended-header: cycle: 1" from output

When I test this case(default lsunit 256k), this case will fail,
as below:
cycle: 1        version: 2              lsn: 1,0        tail_lsn: 1,0
length of Log Record: 258048    prev offset: -1         num ops: 1

...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extended-header: cycle: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

It reports this info because xfs_logprint only read 32k header every time, so it
needs to read more times. We can filter this useless info.

common/log also has _filter_logprint function. only library function is
prefixed with "_", remove '_'.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoext4/002: remove EXT4_EOFBLOCKS_FL test
Eric Whitney [Fri, 14 Feb 2020 16:42:49 +0000 (11:42 -0500)]
ext4/002: remove EXT4_EOFBLOCKS_FL test

This test exercises obsolete ext4-specific functionality that will be
removed in the kernel's 5.7 release.  Once that happens, ext4/002 will
always fail, so remove the test to avoid the noise.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/179: call sync qgroup counts
Anand Jain [Wed, 12 Feb 2020 09:35:09 +0000 (17:35 +0800)]
btrfs/179: call sync qgroup counts

On some systems btrfs/179 fails because the check finds that there
is difference in the qgroup counts.

So as the intention of the test case is to test any hang like
situation during heavy snapshot create/delete operation with quota
enabled, so make sure the qgroup counts are consistent at the end of
the test case, so to make the check happy.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs: xfs mount option sanity test
Zorro Lang [Wed, 29 Jan 2020 05:22:47 +0000 (13:22 +0800)]
xfs: xfs mount option sanity test

XFS is changing to suit the new mount API, so add this case to make
sure the changing won't bring in regression issue on xfs mount
option parse phase, and won't change some default behaviors either.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/btrfs: Improve _require_btrfs_command
Marcos Paulo de Souza [Fri, 7 Feb 2020 13:19:50 +0000 (10:19 -0300)]
common/btrfs: Improve _require_btrfs_command

Now _require_btrfs_command can also check for subfuntion options, like
"subvolume delete --subvolid".

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: test adding filesystem-level fscrypt key via key_id
Eric Biggers [Mon, 3 Feb 2020 18:18:55 +0000 (10:18 -0800)]
generic: test adding filesystem-level fscrypt key via key_id

Add a test which tests adding a key to a filesystem's fscrypt keyring
via an "fscrypt-provisioning" keyring key.  This is an alternative to
the normal method where the raw key is given directly.

For more details, see kernel commit 93edd392cad7 ("fscrypt: support
passing a keyring key to FS_IOC_ADD_ENCRYPTION_KEY").

This test depends on an xfs_io patch which adds the '-k' option to the
'add_enckey' command, e.g.:

xfs_io -c "add_enckey -k KEY_ID" MOUNTPOINT

This test is skipped if the needed kernel or xfs_io support is absent.

This has been tested on ext4, f2fs, and ubifs.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/encrypt: move constant test key to common code
Eric Biggers [Mon, 3 Feb 2020 18:18:54 +0000 (10:18 -0800)]
common/encrypt: move constant test key to common code

For some encryption tests it's helpful to always use the same key so
that the test's output is always the same.

generic/580 already defines such a key, so move it into common/encrypt
so that other tests can use it too.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/rc: handle option with argument in _require_xfs_io_command()
Eric Biggers [Mon, 3 Feb 2020 18:18:53 +0000 (10:18 -0800)]
common/rc: handle option with argument in _require_xfs_io_command()

Fix _require_xfs_io_command() to handle options that take arguments when
the argument is shown in the help text.  E.g., it didn't work to run:

_require_xfs_io_command "add_enckey" "-k"

because the relevant line of the help text is:

-k KEY_ID -- ID of fscrypt-provisioning key containing the raw key

... but the grep command only matched "-k --", not "-k KEY_ID --".

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoREADME: fsgqa needs a home directory too
Christian Kujau [Fri, 31 Jan 2020 21:22:49 +0000 (13:22 -0800)]
README: fsgqa needs a home directory too

generic/128 whould fail with:

     QA output created by 128
    +su: warning: cannot change directory to /home/fsgqa: No such file or directory

Adjust README to create a home directory too. And (totally unrelated),
fix the 404 for the udf_test tool.

Signed-off-by: Christian Kujau <lists@nerdbynature.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoshared/032: add options for reiser4
Christian Kujau [Fri, 31 Jan 2020 20:55:47 +0000 (12:55 -0800)]
shared/032: add options for reiser4

Last night I had xfstests running and after a while it hung at
shared/032 because I had reiser4progs installed and it was waiting
for input:

-----------------------------------------------------------------
mkfs -t reiser4 /dev/ram0
mkfs.reiser4 1.2.1
Format release: 4.0.2
Copyright (C) 2001-2005 by Hans Reiser, licensing governed by
reiser4progs/COPYING.

Block size 4096 will be used.
Linux 5.5.0-rc5-amd64 is detected.
Uuid 2006a590-832a-49f5-9317-cf91bf866dd7 will be used.
Reiser4 is going to be created on /dev/ram0.
(Yes/No):
-----------------------------------------------------------------

The patch below adds an option (cf. reiserfs the line above) so that
the test continues.

Curiously enough the test still "succeeds" for reiser{fs,4} (and jfs
too) because the userspace tools don't appear to have a routine to
check for "contains an existing filesystem", but that could be
addressed in a different patch.

Signed-off-by: Christian Kujau <lists@nerdbynature.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: test unaligned punch hole at ENOSPC
Anand Jain [Fri, 31 Jan 2020 05:09:57 +0000 (13:09 +0800)]
btrfs: test unaligned punch hole at ENOSPC

Try to punch hole with unaligned size and offset when the FS is full
and mounted with nodatacow option.

Mainly holes are punched at locations which are unaligned with the
file extent boundaries when the FS is full by data.  As the punching
holes at unaligned location will involve truncating blocks instead
of just dropping the extents, it shall involve reserving data and
metadata space for delalloc and so data alloc fails as the FS is
full.

btrfs_punch_hole()
 btrfs_truncate_block()
   btrfs_check_data_free_space() <-- ENOSPC

We don't fail punch hole if the holes are aligned with the file
extent boundaries as it shall involve just dropping the related
extents, without truncating data extent blocks.

This test was orignally merged as btrfs/172 (commit 4c2c678cd), then
Iremoved by commit 538d8a4bcc78. But it's decided to bring back this
test case, now the problem is better understood and the fix is
available in the ML as below.

Link: https://patchwork.kernel.org/patch/11357415/
Reviewed-by: Filipe Manana <fdmanana@suse.com>
(cherry picked from commit 4c2c678cd56a81a210cb16f9f9347073e91e2fb0)
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/022: Add debug output
Qu Wenruo [Fri, 7 Feb 2020 01:59:42 +0000 (09:59 +0800)]
btrfs/022: Add debug output

When btrfs/022 fails, its $seqres.full doesn't contain much useful info
to debug.

This patch will add extra debug, including subvolid and full "btrfs
qgroup show" output.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/022: Match qgroup id more correctly
Qu Wenruo [Fri, 7 Feb 2020 01:59:41 +0000 (09:59 +0800)]
btrfs/022: Match qgroup id more correctly

[BUG]
Btrfs/022 sometimes fails with snapshot's reference mismatch with its
source.

[CAUSE]
Since commit fd0830929573 ("fsstress: add the ability to create
snapshots") adds the ability for fsstress to create/delete snapshot and
subvolumes, fsstress will create new subvolumes under test dir.

For example, we could have the following subvolumes created by fsstress:
subvol a id=256
subvol b id=306
qgroupid         rfer         excl
--------         ----         ----
0/5             16384        16384
0/256        13914112        16384
...
0/263         3080192      2306048  << 2 *306* 048
...
0/306        13914112        16384  << 0/ *306

So when we're greping for subvolid 306, it matches qgroup 0/263 first,
which has difference size, and caused false alert.

[FIX]
Instead of greping "$subvolid" blindly, now grep "0/$subvolid" to catch
qgroupid correctly, without hitting rfer/excl values.

Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: Use word mathcing for _btrfs_get_subvolid()
Qu Wenruo [Fri, 7 Feb 2020 01:59:40 +0000 (09:59 +0800)]
btrfs: Use word mathcing for _btrfs_get_subvolid()

Current _btrfs_get_subvolid() can't handle the following case at all:
  # btrfs subvol list $SCRATCH_MNT
  ID 256 gen 9 top level 5 path subv1
  ID 257 gen 7 top level 256 path subv1/subv2
  ID 258 gen 8 top level 256 path subv1/subv3
  ID 259 gen 9 top level 256 path subv1/subv4

If we call "_btrfs_get_subvolid $SCRATCH_MNT subv1" we will get a list
of all subvolumes, not the subvolid of subv1.

To address this problem, we go egrep to match $name which starts with a
space, and at the end of a line.
So that all other subvolumes won't hit.

Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsx: support 64-bit operation counts
Darrick J. Wong [Wed, 5 Feb 2020 00:02:13 +0000 (16:02 -0800)]
fsx: support 64-bit operation counts

Support 64-bit operation counts so that we can run long-soak tests for
more than 2 billion fsxops.

I figured that testcalls and simulatedopcount should both be signed
because numops is also signed.  Granted, I guess numops is signed so
that we can set it to the magic value -1 and have fsx run "forever".

[Eryu: add Darrick's explanation about why we change testcalls to a
signed value.]

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 agoxfs/117: fix inode corruption loop
Darrick J. Wong [Wed, 5 Feb 2020 00:02:07 +0000 (16:02 -0800)]
xfs/117: fix inode corruption loop

`seq X Y` will print all numbers between X and Y, including Y.  Since
inode chunks contain inodes numbered from X to X+63, we need to set the
loop variables correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/020: fix truncation test
Darrick J. Wong [Wed, 5 Feb 2020 00:01:54 +0000 (16:01 -0800)]
xfs/020: fix truncation test

If we can't create the 60T sparse image for testing repair on a large fs
(such as when running on 32-bit), don't bother running the rest of the
test.  This requires the actual truncate(1) command, because it returns
nonzero if the system call fails.

[Eryu: the original bug was introduced by me when committing the
original patch, which was a correct fix. Sorry about that.. ]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/449: filter out "Discarding..." from output
Darrick J. Wong [Wed, 5 Feb 2020 00:01:48 +0000 (16:01 -0800)]
xfs/449: filter out "Discarding..." from output

xfsprogs 5.4 prints "Discarding..." if the disk supports the trim
command.  Filter this out of the output because xfs_info and friends
won't print that out.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/581: try to avoid flakiness in keys quota test
Eric Biggers [Wed, 29 Jan 2020 00:42:51 +0000 (16:42 -0800)]
generic/581: try to avoid flakiness in keys quota test

generic/581 passes for me, but Murphy Zhou reported that it started
failing for him.  The part that failed is the part that sets the key
quota to the fsgqa user's current number of keys plus 5, then tries to
add 6 filesystem encryption keys as the fsgqa user.  Adding the 6th key
unexpectedly succeeded.

What I think is happening is that because the kernel's keys subsystem
garbage-collects keys asynchronously, the quota may be freed up later
than expected after removing fscrypt keys.  Thus the test is flaky.

It would be nice to fix this in the kernel, but unfortunately there
doesn't seem to be an easy fix, and the keys subsystem has always worked
this way.  And it seems unlikely to cause real-world problems, as the
keys quota really just exists to prevent denial-of-service attacks.

So, for now just try to make the test more reliable by:

(1) Reduce the scope of the modified keys quota to just the part of the
    test that needs it.
(2) Before getting the current number of keys for the purpose of setting
    the quota, wait for any invalidated keys to be garbage-collected.

Tested with a kernel that has a 1 second sleep hacked into the beginning
of key_garbage_collector().  With that, this test fails before this
patch and passes afterwards.

Reported-by: Murphy Zhou <xzhou@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Murphy Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: add a test for the btrfs file extent gap issue
Josef Bacik [Tue, 4 Feb 2020 14:37:59 +0000 (09:37 -0500)]
btrfs: add a test for the btrfs file extent gap issue

This is a test to validate that we're not adjusting up i_size before
we have the appropriate file extents on disk.  We had a problem
where i_size would be adjusted up without a contiguous range of file
extents, which isn't ok without a special option enabled.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: add test for incremental send for file with shared extents
Filipe Manana [Mon, 3 Feb 2020 16:19:19 +0000 (16:19 +0000)]
btrfs: add test for incremental send for file with shared extents

Test that an incremental send operation works correctly when a file has
shared extents with itself in the send snapshot, with a hole between them,
and the file size has increased in the send snapshot.

This currently fails in 5.5-rc kernels (regression) but is fixed by a
patch that has the following subject:

  Btrfs: send, fix emission of invalid clone operations within the same file

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/527: add additional test including a file with a hardlink
Filipe Manana [Mon, 3 Feb 2020 16:19:28 +0000 (16:19 +0000)]
generic/527: add additional test including a file with a hardlink

Add a similar test to the existing one but with a file that has a
hardlink as well. This is motivated by a bug found in btrfs where
a fsync on a file that has the old name of another file results
in the logging code to hit an infinite loop. The patch that fixes
the bug in btrfs has the following subject:

  "Btrfs: fix infinite loop during fsync after rename operations"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/130: remove the dangerous group
Filipe Manana [Wed, 22 Jan 2020 12:22:33 +0000 (12:22 +0000)]
btrfs/130: remove the dangerous group

As of the linux kernel commit fd0ddbe2509568 ("Btrfs: send, skip
backreference walking for extents with many references"), the test is no
longer dangerous and it's fast (takes 1 to 2 seconds on a modest vm with
a debug kernel). Therefore remove it from the dangerous group and add it
to the auto and quick groups as well.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/402: Make timestamp range check conditional
Deepa Dinamani [Sun, 19 Jan 2020 00:57:44 +0000 (16:57 -0800)]
generic/402: Make timestamp range check conditional

Addition of fs-specific timestamp range checking was added
in 188d20bcd1eb ("vfs: Add file timestamp range support").

Add a check for whether the kernel supports the limits check
before running the associated test.

Based on an off-list discussion, we use a simpler interim approach
until fsinfo syscall would provide fs timestamp limits info.
This isn't perfect, but works for filesystems expiring in 2038.

Suggested-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/020: call _notrun if we can't create a 60t sparse image
Darrick J. Wong [Thu, 16 Jan 2020 05:11:19 +0000 (21:11 -0800)]
xfs/020: call _notrun if we can't create a 60t sparse image

If we can't create the 60T sparse image for testing repair on a large fs
(such as when running on 32-bit), don't bother running the rest of the
test.

[Eryu: use xfs_io instead of truncate]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/108: skip test if we can't initialize scsi_debug
Darrick J. Wong [Thu, 16 Jan 2020 05:11:13 +0000 (21:11 -0800)]
generic/108: skip test if we can't initialize scsi_debug

Correct the logic in this test that detects failed scsi_debug
initializations.  Downgrade the reaction to _notrun since the filesystem
under test did not fail, just our mockup disk.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/rc: fix _get_max_lfs_filesize on 32-bit platforms
Darrick J. Wong [Thu, 16 Jan 2020 05:11:07 +0000 (21:11 -0800)]
common/rc: fix _get_max_lfs_filesize on 32-bit platforms

The 32-bit calculation of the maximum filesize is incorrect.  Replace it
with the formula that the kernel has used since commit 0cc3b0ec23ce
("Clarify (and fix) MAX_LFS_FILESIZE macros").  This fixes a regression
in generic/351 on 32-bit kernels.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/279: skip test if we can't allocate scsi_debug device
Darrick J. Wong [Thu, 16 Jan 2020 05:11:00 +0000 (21:11 -0800)]
xfs/279: skip test if we can't allocate scsi_debug device

Due to the unique structure of xfs/279 running _get_scsi_debug_dev from
a backtick from inside subshell, the "could not get scsi_debug device"
checks do not actually stop the test when modprobe scsi_debug fails.

Therefore, check the value of SCSI_DEBUG_DEV from the subshell and
_notrun the test if we couldn't get memory.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/507: skip if we can't create a large sparse file for testing
Darrick J. Wong [Thu, 16 Jan 2020 05:10:54 +0000 (21:10 -0800)]
xfs/507: skip if we can't create a large sparse file for testing

Skip this test we can't create the large sparse file needed to test
overflows.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs/122: add disk dquot structure to the list
Darrick J. Wong [Thu, 16 Jan 2020 05:10:48 +0000 (21:10 -0800)]
xfs/122: add disk dquot structure to the list

Add disk dquot structures to the check list now that we killed the
typedef.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoxfs: add a new test for removing ACLs through the attr interface
Christoph Hellwig [Tue, 7 Jan 2020 16:52:55 +0000 (17:52 +0100)]
xfs: add a new test for removing ACLs through the attr interface

Test that removing the SGI_ACL_FILE attr also removes the cached ACL
used for access control checking.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/520: Remove sync in clean_dir
Yang Xu [Mon, 23 Dec 2019 10:21:39 +0000 (18:21 +0800)]
generic/520: Remove sync in clean_dir

When I test this case on xfs, it may fail as below:
--------------------------------------------
 === link SCRATCH_MNT/A/foo SCRATCH_MNT/bar  with fsync SCRATCH_MNT/A ===
+umount: /mnt/xfstests/scratch: target is busy.
+        (In some cases useful info about processes that use
+         the device is found by lsof(8) or fuser(1))
---------------------------------------------

It fails because somethings is still using the fs when we call sync and then
try to unmount it. We can simply remove sync as the unmount is supposed to
persist the file/directory removals.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoltp/fsx: drop caches if we're doing closeopen
Josef Bacik [Tue, 7 Jan 2020 16:55:41 +0000 (11:55 -0500)]
ltp/fsx: drop caches if we're doing closeopen

fsx has a closeopen option where it will close and then re-open the
file.  This is handy, but what is really more useful is to drop the file
from cache completely, so add a drop_caches into this operation so that
the file is read back completely from disk to be really evil.

[Eryu: fix drop cache failure number to stay within 190]

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoltp/fsx: do size check after closeopen operation
Josef Bacik [Tue, 7 Jan 2020 16:55:40 +0000 (11:55 -0500)]
ltp/fsx: do size check after closeopen operation

I was running down a i_size problem and was missing the failure until
the next iteration of fsx operations because we do the file size check
_before_ the closeopen operation.  Move it after the closeopen operation
so we can catch problems where the file gets messed up on disk.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: Add check for required keep_size/punch_hole/zero_range/collapse_range
Xiao Yang [Tue, 7 Jan 2020 08:40:53 +0000 (16:40 +0800)]
generic: Add check for required keep_size/punch_hole/zero_range/collapse_range

Tests need the exact operations to reproduce some issues by
--replay-ops so skip tests rather than one operation if a required
operation/flag in tests is not supported.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agooverlay: test constant ino with nested overlay over non-samefs lower
Amir Goldstein [Mon, 30 Dec 2019 14:14:23 +0000 (16:14 +0200)]
overlay: test constant ino with nested overlay over non-samefs lower

Also test that d_ino of readdir entries and i_ino from /proc/locks are
consistent with st_ino and that inode numbers persist after rename to
new parent, drop caches and mount cycle.

With nested xino configuration, directory st_ino is not persistent and
its st_ino/d_ino/i_ino values are not consistent, so test only non-dir
in this test.

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 agooverlay: test constant ino with nested overlay over samefs lower
Amir Goldstein [Mon, 30 Dec 2019 14:14:22 +0000 (16:14 +0200)]
overlay: test constant ino with nested overlay over samefs lower

Also test that d_ino of readdir entries and i_ino from /proc/locks are
consistent with st_ino and that inode numbers persist after rename to
new parent, drop caches and mount cycle.

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 agooverlay: test file handles with nested overlay over non-samefs lower
Amir Goldstein [Mon, 30 Dec 2019 14:14:21 +0000 (16:14 +0200)]
overlay: test file handles with nested overlay over non-samefs lower

This is a variant of overlay file handles test for an overlayfs that
is nested over another lower overlayfs on non-samefs.

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 agooverlay: test file handles with nested overlay over samefs lower
Amir Goldstein [Mon, 30 Dec 2019 14:14:20 +0000 (16:14 +0200)]
overlay: test file handles with nested overlay over samefs lower

This is a variant of overlay file handles test for an overlayfs that
is nested over another lower overlayfs on the same fs.

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 agooverlay: create the overlay/nested test group
Amir Goldstein [Mon, 30 Dec 2019 14:14:19 +0000 (16:14 +0200)]
overlay: create the overlay/nested test group

For tests that mount an overlayfs over overlayfs.

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 agobtrfs/022: Correct seq number in golden output
Nikolay Borisov [Wed, 8 Jan 2020 10:45:14 +0000 (12:45 +0200)]
btrfs/022: Correct seq number in golden output

The test is merged under index 202 but the golden output contains
201. This makes the test always fail. Correct the number.

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: Test unique st_dev;st_ino on non-samefs setup
Amir Goldstein [Sat, 21 Dec 2019 17:04:47 +0000 (19:04 +0200)]
overlay: Test unique st_dev;st_ino on non-samefs setup

Check that files from middle layer on same fs as upper layer
are not allowed to export the real inode st_dev;st_ino.

This is a regression test for kernel commit:
  9c6d8f13e9da ("ovl: fix corner case of non-unique st_dev;st_ino")

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 agobtrfs/172: Remove the dead test which we have no plan to fix
Qu Wenruo [Tue, 7 Jan 2020 06:01:43 +0000 (14:01 +0800)]
btrfs/172: Remove the dead test which we have no plan to fix

There is no plan to fix it yet, so remove it.

Cc: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoltp/fsstress: Add header file stdbool.h
Yang Xu [Tue, 7 Jan 2020 06:31:26 +0000 (14:31 +0800)]
ltp/fsstress: Add header file stdbool.h

Compilation failed on Fedora 20 because stdbool.h is not included in
xfs/platform_defs-x86_64.h or xfs/linux.h on Fedora 20.

Also, yang xiao fixed similar problem(commit 234f51ebbd) for fsx.c in
2016.2, but after that, fsstress.c started to use bool variable without
including stdbool.h file. It may fail on old linux distributions, so
fix it.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs: regression test for subvol deletion after rename
Josef Bacik [Fri, 20 Dec 2019 14:40:24 +0000 (09:40 -0500)]
btrfs: regression test for subvol deletion after rename

Test removal of a subvolume via rmdir after it has been renamed into a
snapshot of the volume that originally contained the subvolume
reference.

This currently fails on btrfs but is fixed by the patch with the title

  "btrfs: fix invalid removal of root ref"

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsx: fix range overlap check
Darrick J. Wong [Tue, 24 Dec 2019 04:41:06 +0000 (20:41 -0800)]
fsx: fix range overlap check

On 32-bit systems, the offsets are 'unsigned long' (32-bit) which means
that we must cast the explicitly to unsigned long long before feeding
them to llabs.  Without the type conversion we fail to sign-extend the
llabs parameter, try to make a copy/clone/dedupe call with overlapping
ranges, and fsx aborts and the test fails.

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 agogeneric/590: skip test if kernel doesn't support realtime
Yang Xu [Thu, 26 Dec 2019 06:48:36 +0000 (14:48 +0800)]
generic/590: skip test if kernel doesn't support realtime

IMHO, if kernel doesn't supprt realtime, we should skip test.
So add it. Also, when we use _scratch_mkfs on xfs, we will get
the following error:
mkfs failed with extra mkfs options added to "-bsize=4096" by test 590 **

This failure occurs because we have used "export XFS_MKFS_OPTIONS=
${XFS_MKFS_OPTIONS:=-bsize=4096}" in common/config, we don't need to
set it again in extra_options, so remove it.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofstests: verify that xfs_growfs can operate on mounted device node
Eric Sandeen [Tue, 17 Dec 2019 22:34:07 +0000 (16:34 -0600)]
fstests: verify that xfs_growfs can operate on mounted device node

The ability to use a mounted device node as the primary argument
to xfs_growfs was added back in with:
  7e8275f8 xfs_growfs: allow mounted device node as argument
because it was an undocumented behavior that some userspace depended on.
This test exercises that functionality.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/529: use an ACL that doesn't confuse NFS
J. Bruce Fields [Thu, 19 Dec 2019 22:33:36 +0000 (17:33 -0500)]
generic/529: use an ACL that doesn't confuse NFS

For historical reasons having to do with Solaris ACL behavior, the Linux
client treats an ACL like the one used as an example here as equivalent
to a mode, causing listxattr to report that no ACL is set on the file.

(See the comment at the top of fs/nfs_common/nfsacl.c in the kernel
source for details, and the "bogus ACL_MASK entry" comment in the same
source file.)  This causes a spurious generic/529 failure on NFS.

As far as I can tell any ACL should trigger the original XFS problem.
So, modify it so as not to hit this odd NFS corner case.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/139: require 2GB scratch dev
Johannes Thumshirn [Fri, 3 Jan 2020 11:29:05 +0000 (12:29 +0100)]
btrfs/139: require 2GB scratch dev

In my testing on 1GB zram devices btrfs/139 usually fails with
ENOSPC.

Add a requirement for 2GB scratch devices (empirically measured).

Signed-off-by: Johannes Thumshirn <jth@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/14[01]: Use proper helper to get both devid and physical for corruption
Qu Wenruo [Thu, 12 Dec 2019 08:31:23 +0000 (16:31 +0800)]
btrfs/14[01]: Use proper helper to get both devid and physical for corruption

[BUG]
With btrfs-progs v5.4, btrfs/140 and btrfs/141 will fail.

[CAUSE]
Both tests are testing re-silvering of RAID1, thus they need to corrupt
on-disk data.

This requires to do manual logical -> physical bytes mapping in the test
case.
However the test case itself uses too many hard coded helper to grab
physical offset, which will change with mkfs.btrfs.

[FIX]
Use more flex helper, to get both devid and physical for such
corruption.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/dmerror: always try to resume device
Darrick J. Wong [Wed, 11 Dec 2019 05:38:31 +0000 (21:38 -0800)]
common/dmerror: always try to resume device

When we're reloading the error-target dm table, always resume the device
even if the reload fails because (a) we shouldn't leave dm state for the
callers to clean up and (b) the caller don't clean up the state which
just leads to the scratch filesystem hanging on the suspended dm error
device.

Resume the dm device when we're cleaning up so that cleaning up the
scratch filesystem won't hang.

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 agogeneric: verify ciphertext of IV_INO_LBLK_64 encryption policies
Eric Biggers [Mon, 2 Dec 2019 23:01:55 +0000 (15:01 -0800)]
generic: verify ciphertext of IV_INO_LBLK_64 encryption policies

Verify ciphertext for v2 encryption policies that use the IV_INO_LBLK_64
flag and use AES-256-XTS to encrypt file contents and AES-256-CTS-CBC to
encrypt file names.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/encrypt: support verifying ciphertext of IV_INO_LBLK_64 policies
Eric Biggers [Mon, 2 Dec 2019 23:01:54 +0000 (15:01 -0800)]
common/encrypt: support verifying ciphertext of IV_INO_LBLK_64 policies

Update _verify_ciphertext_for_encryption_policy() to support encryption
policies with the IV_INO_LBLK_64 flag set.

This flag modifies the encryption to include the inode number in the IVs
and to use a key derived from the tuple [master_key, fs_uuid, mode_num].
Since the file nonce is *not* included in this key derivation, multiple
files can use the same key.

This flag is supported by v2 encryption policies only -- not by v1.

Signed-off-by: Eric Biggers <ebiggers@google.com>
4 years agocommon/encrypt: create named variables for UAPI constants
Eric Biggers [Mon, 2 Dec 2019 23:01:53 +0000 (15:01 -0800)]
common/encrypt: create named variables for UAPI constants

Use named variables rather than hard-coded numbers + comments.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofscrypt-crypt-util: add HKDF context constants
Eric Biggers [Mon, 2 Dec 2019 23:01:52 +0000 (15:01 -0800)]
fscrypt-crypt-util: add HKDF context constants

Use #defines rather than hard-coded numbers + comments.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofscrypt-crypt-util: create key_and_iv_params structure
Eric Biggers [Mon, 2 Dec 2019 23:01:51 +0000 (15:01 -0800)]
fscrypt-crypt-util: create key_and_iv_params structure

In preparation for adding 3 more input parameters to get_key_and_iv(),
create a structure to hold the input parameters so that the code doesn't
get too unwieldy.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/386: fill missing brackets in awk
Yang Xu [Mon, 30 Dec 2019 02:57:57 +0000 (10:57 +0800)]
generic/386: fill missing brackets in awk

Since commit ea726c4a55c98 to check the correct field from df output,
it introduced a syntax error. Fix it.

Reported-by: Feiyu Zhu <zhufy.jy@cn.fujitsu.com>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/15[78]: Use proper helper to get both devid and physical offset for corruption
Qu Wenruo [Wed, 11 Dec 2019 10:40:29 +0000 (18:40 +0800)]
btrfs/15[78]: Use proper helper to get both devid and physical offset for corruption

[BUG]
When using btrfs-progs v5.4, btrfs/157 and btrfs/158 will fail:

btrfs/157 1s ... - output mismatch (see xfstests/results//btrfs/157.out.bad)
    --- tests/btrfs/157.out 2018-09-16 21:30:48.505104287 +0100
    +++ xfstests/results//btrfs/157.out.bad
2019-12-10 15:35:43.112390076 +0000
    @@ -1,9 +1,9 @@
     QA output created by 157
     wrote 131072/131072 bytes at offset 0
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    -wrote 65536/65536 bytes at offset 9437184
    +wrote 65536/65536 bytes at offset 22020096
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    -wrote 65536/65536 bytes at offset 9437184
    ...
    (Run 'diff -u xfstests/tests/btrfs/157.out xfstests/results//btrfs/157.out.bad'  to see the entire diff)
btrfs/158 2s ... - output mismatch (see xfstests/results//btrfs/158.out.bad)
    --- tests/btrfs/158.out 2018-09-16 21:30:48.505104287 +0100
    +++ xfstests/results//btrfs/158.out.bad
2019-12-10 15:35:44.844388521 +0000
    @@ -1,9 +1,9 @@
     QA output created by 158
     wrote 131072/131072 bytes at offset 0
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    -wrote 65536/65536 bytes at offset 9437184
    +wrote 65536/65536 bytes at offset 22020096
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    -wrote 65536/65536 bytes at offset 9437184
    ...
    (Run 'diff -u xfstests/tests/btrfs/158.out xfstests/results//btrfs/158.out.bad'  to see the entire diff)

[CAUSE]
This two tests use physical offset as golden output, while mkfs.btrfs
can do whatever it likes to arrange its chunk layout, thus physical
offset is never reliable.

And btrfs-progs commit c501c9e3b816 ("btrfs-progs: mkfs: match devid
order to the stripe index") just changed the layout.

So the output mismatch and failed.

[FIX]
In fact, that btrfs-progs commit not only changed offset, but also the
device sequence.

So we can't just simply remove the physical offset, but also need to use
proper helper to get both devid (as its device path) and physical offset
for corruption.

As long as mkfs.btrfs still uses sequential devid, these tests should
handle future chunk layout change without problem.

Reported-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/14[23]: Use proper help to get both devid and physical offset for corruption.
Qu Wenruo [Wed, 11 Dec 2019 10:40:28 +0000 (18:40 +0800)]
btrfs/14[23]: Use proper help to get both devid and physical offset for corruption.

[BUG]
When using btrfs-progs v5.4, btrfs/142 and btrfs/143 will fail:
btrfs/142 1s ... - output mismatch (see xfstests/results//btrfs/142.out.bad)
    --- tests/btrfs/142.out 2018-09-16 21:30:48.505104287 +0100
    +++ xfstests/results//btrfs/142.out.bad
2019-12-10 15:35:40.280392626 +0000
    @@ -3,37 +3,37 @@
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
     wrote 65536/65536 bytes
     XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
    -XXXXXXXX:  aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
    -XXXXXXXX:  aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
    -XXXXXXXX:  aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
    -XXXXXXXX:  aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
    ...
    (Run 'diff -u xfstests/tests/btrfs/142.out xfstests/results//btrfs/142.out.bad' to see the entire diff)

[CAUSE]
Btrfs/14[23] test whether a read on corrupted stripe will re-silver
itself.
Such test by its nature will need to modify on-disk data, thus need to
get the btrfs logical -> physical mapping, which is done by near
hard-coded lookup function, which rely on certain stripe:devid sequence.

Recent btrfs-progs commit c501c9e3b816 ("btrfs-progs: mkfs: match devid
order to the stripe index") changes how we use devices in mkfs.btrfs,
this caused a change in chunk layout, and break the hard-coded
stripe:devid sequence.

[FIX]
This patch will do full devid and physical offset lookup, instead of old
physical offset only lookup.

The only assumption made is, mkfs.btrfs assigns devid sequentially for
its devices.
Which means, for "mkfs.btrfs $dev1 $dev2 $dev3", we get devid 1 for $dev1,
devid 2 for $dev2, and so on.

This change will allow btrfs/14[23] to handle even future chunk layout
change. (Although I hope this will never happen again).

This also addes extra debug output (although less than 10 lines) into
$seqres.full, just in case when layout changes and current lookup can't
handle it, developer can still pindown the problem easily.

Reported-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon: Use more accurate kernel config for _require_fail_make_request
Qu Wenruo [Wed, 11 Dec 2019 10:40:27 +0000 (18:40 +0800)]
common: Use more accurate kernel config for _require_fail_make_request

Just enabling CONFIG_FAIL_MAKE_REQUEST will not fulfill
_require_fail_make_request.

It's CONFIG_FAULT_INJECTION_DEBUG_FS.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agosrc/fssum: skip subvolumes when building a sum
Josef Bacik [Tue, 17 Dec 2019 15:25:05 +0000 (10:25 -0500)]
src/fssum: skip subvolumes when building a sum

With the snapshot/subvolume support added to fsstress I've been seeing
random failures with our send/receive related tests.  This is because
fssum is summing the path with the subvolumes for our test fs'es that
are generated by fsstress.  But with send/receive it skips subvolumes,
which makes the sums mismatch.  Fix this by skipping directories that do
not match our st_dev, which is how we differentiate subvolumes in btrfs.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsstress: allow operations to use either a directory or subvol
Josef Bacik [Thu, 14 Nov 2019 15:58:36 +0000 (10:58 -0500)]
fsstress: allow operations to use either a directory or subvol

Most operations are just looking for a base directory to generate a file
in, they don't actually need a directory specifically.  Add FT_ANYDIR to
cover both directories and subvolumes, and then use this in all the
places where it makes sense.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsstress: add the ability to create snapshots
Josef Bacik [Thu, 14 Nov 2019 15:58:35 +0000 (10:58 -0500)]
fsstress: add the ability to create snapshots

Snapshots are just fancy subvolumes, add this ability so we can stress
snapshot creation.  We get the deletion with SUBVOL_DELETE.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agofsstress: add the ability to create/delete subvolumes
Josef Bacik [Thu, 14 Nov 2019 18:14:15 +0000 (13:14 -0500)]
fsstress: add the ability to create/delete subvolumes

This patch adds support to fsstress for creating and deleting subvolumes
on a btrfs file system.  We link in the libbtrfsutil library to handle
the mechanics of creating and deleting subvolumes instead of duplicating
the ioctl logic.  There is code to check if we're on a btrfs fs at
startup time and if so 0 out the frequency of the btrfs specific
operations.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/386: check the correct field from df output
Theodore Ts'o [Sun, 22 Dec 2019 21:27:30 +0000 (16:27 -0500)]
generic/386: check the correct field from df output

The generic/386 test was checking the "Available" field when it
should have been checking the "1k-blocks" field, which represents
the project quota's hard limit.  On xfs, an empty directory takes no
space, so it doesn't matter.  But for ext4, an empty directory still
takes 4k (or whatever the file system's block size happens to be):

Filesystem           1K-blocks       Used  Available  Use% Pathname
/dev/vdc                512000          4     511996    0% /vdc/test

This causes generic/386 to falsely fail.

This fix is needed to fix generic/386 from failing on ext4:

    hard limit 524283904 bytes, expected 524288000

[Eryu: Used $(NF-4) instead of $2 as Eric Sandeen and Yang Xu
suggested]

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agocommon/rc: fix device size parser
Dennis Zhou [Wed, 11 Dec 2019 20:18:30 +0000 (12:18 -0800)]
common/rc: fix device size parser

If you have multiple devices that share the same regex (eg dm-1, dm10),
then _get_device_size() can return "$size\n$size" which causes the
following error for btrfs/011.

    QA output created by 011
    ./common/rc: line 3084: [: too many arguments

So, fix this by making grep check against whole word.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agoRevert "fstests: Don't use gawk's strtonum"
Eryu Guan [Sun, 15 Dec 2019 16:10:55 +0000 (00:10 +0800)]
Revert "fstests: Don't use gawk's strtonum"

This reverts commit 37520a314bd472ed720ed0611c6b69e418be9b61.

This commit has been reported to regress, at least, xfs/139 and
btrfs/09[58]. Let's revert it for now.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agobtrfs/187: require 8GB scratch dev
Johannes Thumshirn [Thu, 12 Dec 2019 07:45:43 +0000 (08:45 +0100)]
btrfs/187: require 8GB scratch dev

In my testing on 1GB zram devices btrfs/187 usually fails with
ENOSPC.

Add a requirement for 8GB scratch devices (empirically measured).

Cc: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric/590: add _require_xfs_io_command "falloc"
Luis Henriques [Mon, 9 Dec 2019 17:14:52 +0000 (17:14 +0000)]
generic/590: add _require_xfs_io_command "falloc"

Without this check the test will fail with message:

  fallocate: Operation not supported

Instead, with this _require_xfs_io_command, the test will be skipped
instead if falloc isn't supported.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
4 years agogeneric: test splice() with pipes
Darrick J. Wong [Wed, 4 Dec 2019 02:37:24 +0000 (18:37 -0800)]
generic: test splice() with pipes

Andreas Grünbacher reports that on the two filesystems that support
iomap directio, it's possible for splice() to return -EAGAIN (instead of
a short splice) if the pipe being written to has less space available in
its pipe buffers than the length supplied by the calling process.

This is a regression test to check for correct operation. Kernel
needs commit 3253d9d09337 ("splice: only read in as much information
as there is pipe buffer space") to pass.

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 agoxfs/148: sort attribute list output
Darrick J. Wong [Wed, 4 Dec 2019 02:36:42 +0000 (18:36 -0800)]
xfs/148: sort attribute list output

Yang Xu reported a test failure in xfs/148 that I think comes from
extended attributes being returned in a different order than they were
set.  Since order isn't important in this test, sort the output to make
it consistent.

Reported-by: Yang Xu <xuyang2018.ky@cn.fujitsu.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>