]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/log
xfstests-dev.git
9 years agocommon/populate: remove unnecessary devices directory creation
Xiaoguang Wang [Mon, 9 May 2016 00:52:35 +0000 (10:52 +1000)]
common/populate: remove unnecessary devices directory creation

_scratch_ext4_populate and _scratch_xfs_populate try to create
devices directory in xfstests/, so if we run xfs/083 or ext4/006
twice, it'll fail, fix this issue.

Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs: test snapshot create with invalid parent qgroup
Mark Fasheh [Mon, 9 May 2016 00:51:48 +0000 (10:51 +1000)]
btrfs: test snapshot create with invalid parent qgroup

Test that an invalid parent qgroup does not cause snapshot create to
force the FS readonly.

In btrfs, create_pending_snapshot() will go readonly on _any_ error return
from
btrfs_qgroup_inherit(). If qgroups are enabled, a user can crash their fs by
just making a snapshot and asking it to inherit from an invalid qgroup.

This patch does exactly that test. If the FS goes readonly that will be
reported and we will know that a regression was introduced.

The btrfs fix this patch relates to can be found at the following url:
http://thread.gmane.org/gmane.comp.file-systems.btrfs/54755

Thanks,
--Mark

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/299: fix variable name typo
Zorro Lang [Mon, 9 May 2016 00:51:33 +0000 (10:51 +1000)]
xfs/299: fix variable name typo

In xfs/299, project IDs are in $tmp.projid file. But there's one
line code try to use $temp.projid. Fortunately, it doesn't bring
any problems until now, but if keep using $temp.projid it really
don't make sense.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/259: test more block sizes and handle minimum block size correctly
Eryu Guan [Mon, 9 May 2016 00:50:37 +0000 (10:50 +1000)]
xfs/259: test more block sizes and handle minimum block size correctly

Currently xfs/259 tests against TEST_DIR for CRC support status to
decide whether 512 block size should be tested, which is wrong for this
test, because configuration of TEST_DIR is not controlled by test
harness and can be different to the configuration being used in the
test.

Fix it by reversing the block size order that's tested and capture the
output of the actual mkfs command that is being tested, and determine if
512 byte block sizes should be tested based on that output.

While we're at it, I think the test matrix can be enlarged as well, 4k,
2k, 1k and 512 block size can be tested in each fs size boundary, not
only the minimum block size.

Suggested-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoblock: test fallocate for block devices
Darrick J. Wong [Mon, 9 May 2016 00:49:50 +0000 (10:49 +1000)]
block: test fallocate for block devices

Now that we're wiring up fallocate's PUNCH_HOLE and ZERO_RANGE
features for block devices, add some tests to make sure they
work correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs/091: Disable compress to avoid output dismatch
Qu Wenruo [Mon, 9 May 2016 00:46:14 +0000 (10:46 +1000)]
btrfs/091: Disable compress to avoid output dismatch

If run btrfs/091 with "-o compress=lzo" mount option, test case will
fail, as compress makes extent much smaller on disk, making output
different from golden output.

As this test case is only testing qgroup, not compression, disable
compression manually in test case.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogitignore: add src/holetest
Omer Zilberberg [Mon, 9 May 2016 00:45:52 +0000 (10:45 +1000)]
gitignore: add src/holetest

Recently added 450d833 (generic/338: Add mmap race test) added a new
binary, it should be added to .gitignore as well.

Signed-off-by: Omer Zilberberg <omzg@plexistor.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: test fsync after adding a link and moving other inode
Filipe Manana [Mon, 9 May 2016 00:45:20 +0000 (10:45 +1000)]
generic: test fsync after adding a link and moving other inode

Test that if we create a hard link for a file F in some directory A,
then move some directory or file B from its parent directory C into
directory A, fsync file F, power fail and mount the filesystem, the
directory/file B is located only at directory A and both links for
file F exist.

This test is motivated by an issue found in btrfs which is fixed by the
following patch for the linux kernel:

  Btrfs: fix for incorrect directory entries after fsync log replay

Tested against ext3/4, xfs, reiserfs and f2fs.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/273: Remove hard coded block size
Chandan Rajendra [Mon, 9 May 2016 00:45:19 +0000 (10:45 +1000)]
generic/273: Remove hard coded block size

The space occupied by files in the 'origin' directory is calculated with
the assumption that 4k is the block size of the underlying filesystem.
This causes the test to fail with ENOSPC errors when running on
filesystems with larger block sizes. To fix the issue, this commit makes
use of the the block size obtained from the mounted filesystem.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoconfig: git should ignore config files in config directory
Dave Chinner [Mon, 9 May 2016 00:43:29 +0000 (10:43 +1000)]
config: git should ignore config files in config directory

Running a git clean on a xfstests tree causes it to remove the
config files for the given host. Make git ignore custom config
files in this directory so git clean won't completely trash the
local config needed to run xfstests.

Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/082: filter out project quota status
Theodore Ts'o [Tue, 5 Apr 2016 01:49:34 +0000 (11:49 +1000)]
generic/082: filter out project quota status

In the most recent quota tools package, with the new project quota
support, quotaon -p prints an extra line which generic/082.out isn't
expecting.  So filter it out.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: Mark tests which use direct I/O with _requires_odirect
Theodore Ts'o [Tue, 5 Apr 2016 01:49:27 +0000 (11:49 +1000)]
common: Mark tests which use direct I/O with _requires_odirect

There were a number of tests that use Direct I/O that weren't testing
to make sure O_DIRECT is actually supported.  This will be important
for avoiding false positives when testing ext4 encryption (which does
not support DIO for obvious reasons).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoattr: adjust acl_max of f2fs if inline_xattr is set
Jaegeuk Kim [Tue, 5 Apr 2016 01:48:46 +0000 (11:48 +1000)]
attr: adjust acl_max of f2fs if inline_xattr is set

If f2fs gets inline_xattr, it enlarges the whole xattr space, which also enables
to cover more acl entries up to 531 from 506.
This patch detects the mount option, inline_xattr, and changes the result of
_acl_get_max for generic/026.

Fixes: 9f7bf79d0c34 ("attr: add maximum acl count for f2fs")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/030: filter out repeated lines from .out files
Eryu Guan [Tue, 5 Apr 2016 01:48:16 +0000 (11:48 +1000)]
xfs/030: filter out repeated lines from .out files

Commit 31f48569c353 ("xfs/030: fix output on newer filesystems") added
more lines to .out file to match the output from XFS with reflink
support, but it broke test on older XFS.

Dave explained the reason and pointed out the correct way to fix it, so
I just quote Dave's mail here:

"The problem here is that reflink triggers a change in the initial
population of the AGFL - from 4 blocks to 6 blocks, and so repair warns
6 times instead of 4. After filtering, that gives 6 indentical output
lines instead of 4.

Doing something as simple as collapsing repeated identical lines (e.g
filtering through uniq) will work for all filesystem formats and any
future changes that modify the initial AGFL population."

Suggested-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: add test for fsync after renaming file
Filipe Manana [Tue, 5 Apr 2016 01:47:55 +0000 (11:47 +1000)]
generic: add test for fsync after renaming file

Test that if we rename a file, create a new file that has the old name
of the other file and is a child of the same parent directory, fsync the
new inode, power fail and mount the filesystem, we do not lose the first
file and that file has the name it was renamed to.

This test is motivated by an issue found in btrfs which is fixed by the
following patch for the linux kernel:

  "Btrfs: fix file loss caused by fsync after rename and new inode"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: add test for fsync after renaming directory
Filipe Manana [Tue, 5 Apr 2016 01:47:31 +0000 (11:47 +1000)]
generic: add test for fsync after renaming directory

Test that if we rename a directory, create a new file or directory that
has the old name of our former directory and is a child of the same
parent directory, fsync the new inode, power fail and mount the
filesystem, we see our first directory with the new name and no files
under it were lost.

This test is motivated by an issue found in btrfs which is fixed by the
following patch for the linux kernel:

  "Btrfs: fix file loss caused by fsync after rename and new inode"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/206: filter out reflink related outputs
Eryu Guan [Tue, 5 Apr 2016 01:47:02 +0000 (11:47 +1000)]
xfs/206: filter out reflink related outputs

Commit 13717ffc96fe ("xfs/206: fix output when mkfs knows about
reflink") added extra lines to xfs/206.out to fit the mkfs output with
reflink support, but broke tests without reflink support.

Fix it by filtering out reflink related outputs, just like filtering out
crc related outputs in the test.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/244: avoid creating too large random ID
Eryu Guan [Tue, 5 Apr 2016 01:46:31 +0000 (11:46 +1000)]
generic/244: avoid creating too large random ID

ppc64 hosts are generating too large random IDs like 725294314141253632,
which causes all sorts of errors in test.

Fix it by using format "-t uI" for 'int' size and it works fine on all
platforms.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: replace chattr with $CHATTR_PROG
Josef Bacik [Tue, 5 Apr 2016 01:46:12 +0000 (11:46 +1000)]
common: replace chattr with $CHATTR_PROG

We have a wrapper around chattr to make sure people don't do the wrong thing on
their boxes, so we need to be able to specify CHATTR_PROG and have it actually
work, so replace all chattr calls with $CHATTR_PROG.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocheck: make results/check.log match everybody else
Josef Bacik [Tue, 5 Apr 2016 01:45:41 +0000 (11:45 +1000)]
check: make results/check.log match everybody else

results/check.log is inconsistent with what goes to stdout and $tmp.summary.  It
passes the ran and failed tests through fmt but not the "Not Run" tests for some
reason, and nobody else passes it through fmt.  So fix this to be the same
output as what goes to stdout and $tmp.summary to make for easier post parsing.
Now we'll get

Ran: <single line with all the tests>
Not run: <single line with all the not run tests>
Failures: <single line with all the failed tests>

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs: add test for fsync after snapshot deletion
Filipe Manana [Tue, 5 Apr 2016 01:45:12 +0000 (11:45 +1000)]
btrfs: add test for fsync after snapshot deletion

Test that if we delete a snapshot, delete its parent directory, create
another directory with the same name as that parent and then fsync either
the new directory or a file inside the new directory, the fsync succeeds,
the fsync log is replayable and produces a correct result.

This is motivated by a bug that is fixed by the following patch for
btrfs (linux kernel):

  Btrfs: fix unreplayable log after snapshot deletion and parent
  re-creation

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: make sure dm device is all settled before removing it
Eryu Guan [Tue, 5 Apr 2016 01:44:33 +0000 (11:44 +1000)]
common: make sure dm device is all settled before removing it

_dmerror_cleanup()/_cleanup_flakey may fail to remove dm device due to
EBUSY and cause subsequent tests to fail.

Fix it by calling $UDEV_SETTLE_PROG before remove dm device to make sure
no one is using it.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/338: Add mmap race test
Jan Kara [Tue, 5 Apr 2016 01:44:05 +0000 (11:44 +1000)]
generic/338: Add mmap race test

Add test which spawns two threads racing to write to file via mmap and
checks the result. This is mainly interesting to uncover races in DAX
fault handling.

Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Brian Boylston <brian.boylston@hpe.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs: test log replay with qgroups enabled and orphan roots
Filipe Manana [Tue, 5 Apr 2016 01:42:21 +0000 (11:42 +1000)]
btrfs: test log replay with qgroups enabled and orphan roots

Test that replaying a log tree when qgroups are enabled and orphan roots
(deleted snapshots) exist, the replay process does not crash.

This is motivated by a bug found in btrfs, introduced in the linux kernel
4.4 release, and is fixed by the linux kernel commit 909c3a22da3b
("Btrfs: fix loading of orphan roots leading to BUG_ON") that landed in
kernel 4.5.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agolib/tlibio: Fix a build warning
Satoru Takeuchi [Tue, 5 Apr 2016 01:41:40 +0000 (11:41 +1000)]
lib/tlibio: Fix a build warning

Remove the following warning message.

  ===============================
  tlibio.c: In function 'lio_set_debug':
  tlibio.c:212:1: warning: type of 'level' defaults to 'int' [-Wimplicit-int]
   lio_set_debug(level)
   ^
  ==============================

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agooverlay/001: change supported fs from generic to overlay
Filipe Manana [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
overlay/001: change supported fs from generic to overlay

The supported fs was set to generic by mistake, so fix it by setting it
to the proper type 'overlay'.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocheck: catch general protection fault traces in _check_dmesg
Filipe Manana [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
check: catch general protection fault traces in _check_dmesg

While writing a test case for overlayfs I noticed that _check_dmesg()
did not detect general protection fault traces like the following:

[15277.026108] run fstests overlay/002 at 2016-03-21 18:42:27
[15277.933179] general protection fault: 0000 [#11] PREEMPT SMP DEBUG_PAGEALLOC
[15277.935427] Modules linked in: btrfs overlay ppdev crc32c_generic evdev xor raid6_pq psmouse pcspkr sg serio_raw acpi_cpufreq parport_pc parport tpm_tis i2c_piix4
[15277.936011] CPU: 15 PID: 22762 Comm: xfs_io Tainted: G      D         4.5.0-rc6-btrfs-next-26+ #1
[15277.936011] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014
[15277.936011] task: ffff88001f6f1340 ti: ffff88000a3f8000 task.ti: ffff88000a3f8000
[15277.936011] RIP: 0010:[<ffffffffa030b7ab>]  [<ffffffffa030b7ab>] btrfs_sync_file+0x11b/0x3e9 [btrfs]
[15277.936011] RSP: 0018:ffff88000a3fbe40  EFLAGS: 00010286
[15277.936011] RAX: 0000000080000000 RBX: ffff8800b0152c88 RCX: 0000000000000001
[15277.936011] RDX: 0000000000000001 RSI: ffffffff8148fec0 RDI: 00000000ffffffff
[15277.936011] RBP: ffff88000a3fbec0 R08: 0000000000000001 R09: 0000000000000000
[15277.936011] R10: ffff88000a3fbe40 R11: 0000000000000246 R12: 6e756f635f657269
[15277.936011] R13: 0000000000000000 R14: 00000000014655a0 R15: ffff88017dd25e40
[15277.936011] FS:  00007f27f0e1f700(0000) GS:ffff88023ede0000(0000) knlGS:0000000000000000
[15277.936011] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[15277.936011] CR2: 00007f27f0e2f000 CR3: 000000013aadf000 CR4: 00000000000006e0
[15277.936011] Stack:
[15277.936011]  ffffffff8108b5cc ffff88000a3fbec0 0000000000000246 ffff880125abaed0
[15277.936011]  ffff8800b0152d60 8000000000000000 7fffffffffffffff 0000000000000246
[15277.936011]  0000000000000246 ffffffff81074f9b ffffffff8104357c ffff88017dd25e40
[15277.936011] Call Trace:
[15277.936011]  [<ffffffff8108b5cc>] ? arch_local_irq_save+0x9/0xc
[15277.936011]  [<ffffffff81074f9b>] ? ___might_sleep+0xce/0x217
[15277.936011]  [<ffffffff8104357c>] ? __do_page_fault+0x3c0/0x43a
[15277.936011]  [<ffffffff811a2351>] vfs_fsync_range+0x8c/0x9e
[15277.936011]  [<ffffffff811a237f>] vfs_fsync+0x1c/0x1e
[15277.936011]  [<ffffffff811a24d6>] do_fsync+0x31/0x4a
[15277.936011]  [<ffffffff811a2700>] SyS_fsync+0x10/0x14
[15277.936011]  [<ffffffff81493617>] entry_SYSCALL_64_fastpath+0x12/0x6b
[15277.936011] Code: 85 c0 0f 85 e2 02 00 00 48 8b 45 b0 31 f6 4c 29 e8 48 ff c0 48 89 45 a8 48 8d 83 d8 00 00 00 48 89 c7 48 89 45 a0 e8 fc 43 18 e1 <f0> 41 ff 84 24
[15277.936011] RIP  [<ffffffffa030b7ab>] btrfs_sync_file+0x11b/0x3e9 [btrfs]
[15277.936011]  RSP <ffff88000a3fbe40>
[15277.974598] ---[ end trace 721e14960eb939c1 ]---

So teach it to look out for such traces.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agooverlayfs: test fsync on merged directory
Filipe Manana [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
overlayfs: test fsync on merged directory

Test that calling fsync against a file using the merged directory does
not result in a crash nor fails unexpectedly.

This is motivated by a change in overlayfs that resulted in a crash
(invalid memory access) when the lower or upper directory belonged to
a btrfs file system. The overlayfs change came in commit 4bacc9c9234
(overlayfs: Make f_path always point to the overlay and f_inode to the
underlay). At the moment there are two patches in the linux-fsdevel
and linux-btrfs mailing lists to fix this problem:

  * vfs: add file_dentry()
  * Btrfs: fix crash/invalid memory access on fsync when using overlayfs

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs: 'subvolume stress' tasks need to exit gracefully
Chandan Rajendra [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
btrfs: 'subvolume stress' tasks need to exit gracefully

The following scenario can occur when running btrfs/066,

  Task A                                Task B                     Task C

  run_test()
  - Execute _btrfs_stress_subvolume()
    in a background shell.
                                        _btrfs_stress_subvolme()
                                          ...
                                        - fork & exec "mount"
                                                          Mount subvolume on directory in $TEST_DIR
  - Wait for fsstress to finish                                    do_mount()
  - kill shell process executing                                   - btrfs_mount()
    _btrfs_stress_subvolume()
    i.e. Task B.
  - Init process becomes the parent
    of "subvolume mount" task
    i.e. Task C.
  - In case subvolume is mounted
    (which is not the case),
    unmount it.
                                                                   - Complete mounting subvolume

Hence on the completion of one iteration of run_test(), the subvolume
created inside the filesystem on $SCRATCH_DEV continues to be mounted on
$TEST_DIR/$seq.mnt. Subsequent invocations of run_test() (called for
remaining Btrfs profile configs) fail during _scratch_pool_mkfs.

Instead of killing the 'subvolume stress' task this commit makes
_btrfs_stress_subvolume() to break out of the loop when a file exists
on the filesystem. The commit also makes relevant changes to other
users of _btrfs_stress_subvolume() i.e. btrfs/060, btrfs/065,
btrfs/067 & btrfs/068.

Suggested-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/073: avoid finobt warning from mkfs
Eryu Guan [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
xfs/073: avoid finobt warning from mkfs

When testing xfs/073 with MKFS_OPTIONS="-m crc=1,finobt=1" set, it fails
due to extra warning about disabling finobt feature:

 +warning: finobt not supported without CRC support, disabled.

Because xfs/073 disables crc unconditionally and finobt can not be
enabled either.

Fix it by explicitly disabling finobt as well.

Also remove all meta related mkfs options in _scratch_mkfs_xfs_opts() if
mkfs.xfs has no metadata support, not only the crc option. So that test
still passes on distros with such old binaries.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/191: Remove obsolete nfs4acl tests
Andreas Gruenbacher [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
xfs/191: Remove obsolete nfs4acl tests

The nfs4acl tests don't make sense anymore as they have been obsoleted
by richacls.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoRename output file templates to match TEST.out*
Andreas Gruenbacher [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
Rename output file templates to match TEST.out*

Rename the expected output files so that they match "$TEST_NAME.out*";
this makes the file names a bit more consistent.

Add $TEST_NAME.out and similar symlinks to .gitignore.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agofstests: make xfs/006 generic
Eryu Guan [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
fstests: make xfs/006 generic

xfs/006 has no requirements that are specific to XFS, so make it generic
and other filesystems could get some coverage too.

Along with the movement, I also added a test that removes all created
dirs, as that's how the original bug was found.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs/059: add a filter for btrfs compression property
Wang Xiaoguang [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
btrfs/059: add a filter for btrfs compression property

btrfs/059.out should not be hardcoded to zlib, if compression method
is lzo, this case will fail wrongly, so here add a filter.

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: test I/O on dm error device
Eryu Guan [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
generic: test I/O on dm error device

This is a test that performs simple I/O on dm error device, which
returns EIO on all I/O request.

This is motivated by an ext4 bug that crashes kernel on error path when
trying to update atime. Following kernel patch should fix the issue

  ext4: fix NULL pointer dereference in ext4_mark_inode_dirty()

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/209: filter scratch dir properly
Christoph Hellwig [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
xfs/209: filter scratch dir properly

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs: remove NOCOW_FL testing from test
Darrick J. Wong [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
xfs: remove NOCOW_FL testing from test

Since XFS dropped support for the NOCOW_FL flag, cut it out of the tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs: test per-ag allocation accounting during truncate-caused refcountbt expansion
Darrick J. Wong [Wed, 23 Mar 2016 06:39:09 +0000 (17:39 +1100)]
xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion

Ensure that refcountbt allocations during truncate operations come
from the per-AG reservation and are not charged to the transaction.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/122: support rmapxbt
Darrick J. Wong [Wed, 23 Mar 2016 06:37:32 +0000 (17:37 +1100)]
xfs/122: support rmapxbt

Support the extended rmap btree key structure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/122: define _GNU_SOURCE when compiling test program
Darrick J. Wong [Wed, 23 Mar 2016 06:37:32 +0000 (17:37 +1100)]
xfs/122: define _GNU_SOURCE when compiling test program

This makes it so we don't get warnings about off64_t not being
defined when compiling the test program.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/073: fix output
Darrick J. Wong [Wed, 23 Mar 2016 06:37:32 +0000 (17:37 +1100)]
xfs/073: fix output

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs/030: fix output on newer filesystems
Darrick J. Wong [Wed, 23 Mar 2016 06:37:32 +0000 (17:37 +1100)]
xfs/030: fix output on newer filesystems

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/206: fix output when mkfs knows about reflink
Darrick J. Wong [Wed, 23 Mar 2016 06:37:32 +0000 (17:37 +1100)]
xfs/206: fix output when mkfs knows about reflink

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/23[3-6]: don't source common/xfs, it doesn't exist
Darrick J. Wong [Wed, 23 Mar 2016 06:37:31 +0000 (17:37 +1100)]
xfs/23[3-6]: don't source common/xfs, it doesn't exist

Don't source common/xfs, since it doesn't (yet) exist.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoreflink: fix fragmentation tests to work on >4k block size filesystems
Darrick J. Wong [Wed, 23 Mar 2016 06:37:31 +0000 (17:37 +1100)]
reflink: fix fragmentation tests to work on >4k block size filesystems

For tests that only overwrite part of a file, only consider the number
of extents in the *rewritten* blocks when deciding if the FS
fragmentation performance is satisfactory.

(Also slip in a fix for xfs/127 so that it formats correctly when we
specify big blocksizes via MKFS_OPTIONS.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs: test copy-on-write leftover recovery
Darrick J. Wong [Wed, 23 Mar 2016 06:37:29 +0000 (17:37 +1100)]
xfs: test copy-on-write leftover recovery

Test recovery of CoW leftovers in xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist
Darrick J. Wong [Wed, 23 Mar 2016 03:36:09 +0000 (14:36 +1100)]
xfs/207: fix golden output to match FS_IOC_FSSETXATTR hoist

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs/048: user filter for property error messages
David Sterba [Wed, 23 Mar 2016 03:35:25 +0000 (14:35 +1100)]
btrfs/048: user filter for property error messages

Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agofilter.btrfs: new filter for property messages
David Sterba [Wed, 23 Mar 2016 03:35:14 +0000 (14:35 +1100)]
filter.btrfs: new filter for property messages

The error message in newer btrfs utilities contains name of the
property, we want to filter it out so it matches golden output. There's
an optional parameter with property name that is matched against the
command output.

Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs/118: remove call to _need_to_be_root
Filipe Manana [Wed, 23 Mar 2016 03:34:47 +0000 (14:34 +1100)]
btrfs/118: remove call to _need_to_be_root

The function _need_to_be_root does not exists anymore as of commit
56ff01f471c9 ("xfstests: remove _need_to_be_root").

A v2 of the patch that added test btrfs/118 without calling this
function was sent but not picked [1], instead v1 was picked.

So fix this now.

[1] https://patchwork.kernel.org/patch/8354831/

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/137: require scratch to be CRC enabled XFS
Eryu Guan [Wed, 23 Mar 2016 03:33:57 +0000 (14:33 +1100)]
xfs/137: require scratch to be CRC enabled XFS

This test is only valid for CRC enabled XFS, and test fails with
MKFS_OPTIONS="-m crc=0" being set (no mount failure detected).

Fix it by adding _require_scratch_xfs_crc, which ensures scratch device
has CRC support and enabled.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoext4: defrag not supported with DAX
Ross Zwisler [Wed, 23 Mar 2016 03:33:40 +0000 (14:33 +1100)]
ext4: defrag not supported with DAX

As of this kernel commit:

commit 73f34a5e2ced ("ext4: online defrag not supported with DAX")

online defrag operations for ext4 are disallowed when the filesystem is
mounted with the DAX option.

This causes several xfstests to fail because they expect the defrag
operation to change the file layout:

ext4/308  [failed, exit status 1] - output mismatch (see /root/xfstests/results//ext4/308.out.bad)
    --- tests/ext4/308.out 2015-10-02 10:19:36.791795792 -0600
    +++ /root/xfstests/results//ext4/308.out.bad 2016-02-17 16:20:52.330454602 -0700
    @@ -23,659 +23,5 @@
     50f924a5dc9b03609a4577f9f961414b  SCRATCH_MNT/test.10
     Perform compacting
     50f924a5dc9b03609a4577f9f961414b  SCRATCH_MNT/test.10
    -Perform compacting, second pass
    -50f924a5dc9b03609a4577f9f961414b  SCRATCH_MNT/test.10
    -Create file with 20 * 2 fragments
    -wrote 1234/1234 bytes at offset 0
    ...
    (Run 'diff -u tests/ext4/308.out /root/xfstests/results//ext4/308.out.bad'  to see the entire diff)
generic/018 1s ... [failed, exit status 1] - output mismatch (see /root/xfstests/results//generic/018.out.bad)
    --- tests/generic/018.out 2016-02-17 16:02:40.103656140 -0700
    +++ /root/xfstests/results//generic/018.out.bad 2016-02-17 16:20:53.117459173 -0700
    @@ -10,10 +10,6 @@
     After: 1
     Write backwards sync, but contiguous - should defrag to 1 extent
     Before: in_range(5, 10)
    -After: 1
    -Write backwards sync leaving holes - defrag should do nothing
    -Before: 16
    -After: 16
    ...
    (Run 'diff -u tests/generic/018.out /root/xfstests/results//generic/018.out.bad'  to see the entire diff)

Avoid this by skipping over defrag tests if we are using ext4 + DAX.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: filter more messages from _scratch_mkfs_ext4
Eryu Guan [Wed, 23 Mar 2016 03:32:51 +0000 (14:32 +1100)]
common: filter more messages from _scratch_mkfs_ext4

Commit a94334afa2ff ("common: filter warning messages from mkfs.ext4")
filtered warning messages from mke2fs stderr output but missed the
mke2fs version infomation message, and generic/135 still fails because
of this

  QA output created by 135
 +mke2fs 1.42.9 (28-Dec-2013)
  0000000 1212 1212 1212 1212 1212 1212 1212 1212

So also filter out this message in _scratch_mkfs_ext4.

Reported-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoattr: add maximum acl count for f2fs
Chao Yu [Sun, 28 Feb 2016 23:19:23 +0000 (10:19 +1100)]
attr: add maximum acl count for f2fs

Add a max acl count into common/attr for f2fs in order to make
f2fs passing generic/026 test case.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agofstests: update autoconf rules to define _GNU_SOURCE where needed
Eryu Guan [Sun, 28 Feb 2016 23:19:05 +0000 (10:19 +1100)]
fstests: update autoconf rules to define _GNU_SOURCE where needed

Starting from xfsprogs commit cb898f157f84 ("linux.h: Use off64_t
instead of loff_t") in v4.5-rc1, fstests failed to build because of
configure error:

    checking xfs/xfs.h usability... no
    checking xfs/xfs.h presence... yes
    configure: WARNING: xfs/xfs.h: present but cannot be compiled
    configure: WARNING: xfs/xfs.h:     check for missing prerequisite headers?
    configure: WARNING: xfs/xfs.h: see the Autoconf documentation
    configure: WARNING: xfs/xfs.h:     section "Present But Cannot Be Compiled"
    configure: WARNING: xfs/xfs.h: proceeding with the compiler's result
    checking for xfs/xfs.h... no

    FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.
    Run "make install-qa" from the xfsprogs source.

and that's because off64_t is not defined without _GNU_SOURCE being set.

Fix it by updating the autoconf rules adding _GNU_SOURCE define for the
following checks:

xfs.h libxfs.h xfs_log_format.h xlog_assign_lsn xqm.h xfsctl

Suggested-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agofstests: generic test for listing an inode's xattrs
Filipe Manana [Sun, 28 Feb 2016 23:18:51 +0000 (10:18 +1100)]
fstests: generic test for listing an inode's xattrs

Test that the filesystem's implementation of the listxattrs system call
lists all the xattrs an inode has.

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

  "Btrfs: fix listxattrs not listing all xattrs packed in the same item"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: filter warning messages from mkfs.ext4
Theodore Ts'o [Sun, 28 Feb 2016 23:18:32 +0000 (10:18 +1100)]
common: filter warning messages from mkfs.ext4

Commit 4a5cda8102828 ("xfstests: do not unmount tmpfs during remount")
changed generic/135 to no longer redirect stderr to /dev/null when
running _scratch_mkfs.  This caused ext4 using a 1k block size to fail
when running this test because mkfs.ext4 would issue a warning message
about the use of a non-block size that wasn't expected by golden
output for the test.  Fix this by filtering out warning messages in
_scratch_mkfs_ext4.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agodefrag: require extents support for ext4 defrag
Theodore Ts'o [Sun, 28 Feb 2016 23:18:17 +0000 (10:18 +1100)]
defrag: require extents support for ext4 defrag

The e4defrag program requires the use of fallocate, which in turn
means that the file system must have extents.  Enforce this
requirement so we don't get test failure noise when testing ext4's
ext3 compatibility.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/125: add _require_odirect
Theodore Ts'o [Sun, 28 Feb 2016 23:17:56 +0000 (10:17 +1100)]
generic/125: add _require_odirect

Also remove generic/125 from the auto group, and add it to the new
pnfs group.  This is to document where this test might be useful; it's
not really going to be useful for most normal on-disk file systems, so
remove it from the auto group.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/312: remove dependency on /proc/partitions
Hugh Dickins [Sun, 28 Feb 2016 23:17:34 +0000 (10:17 +1100)]
generic/312: remove dependency on /proc/partitions

We don't need to do this test at all, since _scratch_mkfs_sized will
do this check for us.   This allows this test to work with tmpfs.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogitignore: add src/test-nextquota
Theodore Ts'o [Sun, 21 Feb 2016 21:37:45 +0000 (08:37 +1100)]
gitignore: add src/test-nextquota

Commit 1dfb50585c09 (quota: test Q_GETNEXTQUOTA) added a new binary
without updating .gitignore.  Fix this.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agofstests: btrfs/011 add debug logs to seqres.full
Anand Jain [Sun, 21 Feb 2016 21:37:15 +0000 (08:37 +1100)]
fstests: btrfs/011 add debug logs to seqres.full

Signed-off-by: Anand Jain <anand.jain@oracle.com>
9 years agobtrfs/011: use replace_options
Anand Jain [Sun, 21 Feb 2016 21:37:14 +0000 (08:37 +1100)]
btrfs/011: use replace_options

This patch fixes test btrfs/011 which intended to use -r option
but was never used since its associated args 'replace_options'
didn't make it to the cli.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: test file fsync after rename operation
Filipe Manana [Fri, 19 Feb 2016 01:15:33 +0000 (12:15 +1100)]
generic: test file fsync after rename operation

Test that if we have a file F1 with two links, one in a directory A and
the other in directory B, if we remove the link in directory B, move some
other file F2 from directory B into directory C, fsync inode F1, power
fail and remount the filesystem, file F2 exists and is located only in
directory C.

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

   "Btrfs: fix file loss on log replay after renaming a file and fsync"

Tested against ext3, ext4, xfs, f2fs and reiserfs.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: test directory fsync after rename operation
Filipe Manana [Fri, 19 Feb 2016 01:15:17 +0000 (12:15 +1100)]
generic: test directory fsync after rename operation

Test that if we move one file between directories, fsync the parent
directory of the old directory, power fail and remount the filesystem,
the file is not lost and it's located at the destination directory.

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

  "Btrfs: fix file loss on log replay after renaming a file and fsync"

Tested against ext3, ext4, xfs, f2fs and reiserfs.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: fix _require_fs_space on remote file systems
Christoph Hellwig [Thu, 18 Feb 2016 23:51:47 +0000 (10:51 +1100)]
common: fix _require_fs_space on remote file systems

Remove the -l flag to df so that it works properly on NFS and co.

This fixes various failures in new COW tests on NFS.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs/24[356]: check for -c switch to xfs_io bmap command
Darrick J. Wong [Thu, 18 Feb 2016 23:51:25 +0000 (10:51 +1100)]
xfs/24[356]: check for -c switch to xfs_io bmap command

Extend _require_xfs_io_command so that we can pass it a command line
argument to look for, and then use new capabililty in the relevant
tests to ensure that bmap knows how to dump CoW fork contents (bmap -c)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agopunch-alternating: use the block size reported by the fs for punching
Darrick J. Wong [Thu, 18 Feb 2016 23:51:17 +0000 (10:51 +1100)]
punch-alternating: use the block size reported by the fs for punching

When we're trying to punch alternating blocks out of a file, use the
bsize reported by fstatfs so that we can punch out single blocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/304: fix high offset
Darrick J. Wong [Thu, 18 Feb 2016 23:50:58 +0000 (10:50 +1100)]
generic/304: fix high offset

"Invalid argument" is a better response to an impossibly high offset
dedupe request than "extents don't match", so change the test.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agobtrfs: test directory fsync after deleting snapshots
Filipe Manana [Thu, 18 Feb 2016 23:50:32 +0000 (10:50 +1100)]
btrfs: test directory fsync after deleting snapshots

Test that if we fsync a directory that had a snapshot entry in it that
was deleted and crash, the next time we mount the filesystem, the log
replay procedure will not fail and the snapshot is not present anymore.

This issue is fixed by the following patch for the linux kernel:

  "Btrfs: fix unreplayable log after snapshot delete + parent dir fsync"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs: new test default user/group quota
Zorro Lang [Thu, 18 Feb 2016 23:49:54 +0000 (10:49 +1100)]
xfs: new test default user/group quota

When default quota is set, all different quota types inherits the
same default value, include group quota. So if a user quota limit
larger than the default user quota value, it will still be limited
by the group default quota value.

An upstream patch for this bug:

  xfs: Split default quota limits by quota type

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfstests: remove _need_to_be_root
Theodore Ts'o [Thu, 18 Feb 2016 23:49:17 +0000 (10:49 +1100)]
xfstests: remove _need_to_be_root

The check script requires that it be run as root, so adding
individualized checks for this in each teat is not needed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfstests: increase tmpfs memory size
Hugh Dickins [Thu, 18 Feb 2016 23:48:48 +0000 (10:48 +1100)]
xfstests: increase tmpfs memory size

512M is not enough for generic/129.  Raise default tmpfs size to 1G.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfstests: add executable permission to tests
Hugh Dickins [Thu, 18 Feb 2016 23:48:38 +0000 (10:48 +1100)]
xfstests: add executable permission to tests

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/079,277: require chattr, not xattrs
Hugh Dickins [Thu, 18 Feb 2016 23:47:55 +0000 (10:47 +1100)]
generic/079,277: require chattr, not xattrs

Add a new helper, _require_chattr, which allows the test to explicitly
check to see if the file system supports a specific chattr flag, as
not all file systems support chattr +A or chattr +i, and the presence
of extended attribute support is has nothing to do with a specific
chattr flag being supported.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/009: require fiemap
Hugh Dickins [Thu, 18 Feb 2016 23:46:27 +0000 (10:46 +1100)]
generic/009: require fiemap

Require xfs_io commands fiemap and falloc as well as fzero: fzero
without falloc is unlikely, but tmpfs may later support fzero, though
probably never fiemap (and in v3.15 wrongly claimed to support fzero).

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/053: do not unmount before calling _check_scratch_fs()
Junho Ryu [Thu, 18 Feb 2016 23:45:55 +0000 (10:45 +1100)]
generic/053: do not unmount before calling _check_scratch_fs()

Fix generic/053 so it works on tmpfs by relying on _check_scratch_fs
to unmount before checking the file system and remounting it
afterwards.  Many other tests rely on this, and since tmpfs does not
have a file system consistency checker, this allows the test to
succeed because the files don't disappear when the tmpfs file system
is unmounted.

Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfstests: do not unmount tmpfs during remount
Junho Ryu [Thu, 18 Feb 2016 23:45:35 +0000 (10:45 +1100)]
xfstests: do not unmount tmpfs during remount

Several tests unmount then re-mount the scratch filesystem, to check
that the content is unchanged; but unmounting a tmpfs is designed to
lose its content, which causes such tests to fail unnecessarily.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoRename _test_mount to _test_cycle_mount
Theodore Ts'o [Thu, 18 Feb 2016 23:45:04 +0000 (10:45 +1100)]
Rename _test_mount to _test_cycle_mount

This makes it clear when we are using "mount ; umount" versus "mount
-o remount" for most file systems.  The reason for this distinction is
(a) tests may want to test the difference between what happens on the
remount versus the munt paths, (b) with tmpfs, "mount ; umount" will
cause the contents of all of the files to disappear which makes many
tests sad, and (c) some mount options may not be changed using "mount
-o remount".

Currently _test_mount performs "_test_mount ; _test_umount"
so mechnically rename this function to _test_cycle_mount.  This was
done mechnically using the script fragment:

git grep -E "_test_remount" | \
awk -F: '{print $1}' | sort -u | grep -v tests/xfs/189 \
xargs sed -i 's/_test_remount/_test_cycle_mount/g'

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoRename _scratch_mount to _scratch_cycle_mount
Theodore Ts'o [Thu, 18 Feb 2016 23:44:53 +0000 (10:44 +1100)]
Rename _scratch_mount to _scratch_cycle_mount

This makes it clear when we are using "mount ; umount" versus "mount
-o remount" for most file systems.  The reason for this distinction is
(a) tests may want to test the difference between what happens on the
remount versus the munt paths, (b) with tmpfs, "mount ; umount" will
cause the contents of all of the files to disappear which makes many
tests sad, and (c) some mount options may not be changed using "mount
-o remount".

Currently _scratch_mount performs "_scratch_mount ; _scratch_umount"
so mechnically rename this function to _scratch_cycle_mount.  This was
done mechnically using the script fragment:

git grep "_scratch_remount" | \
awk -F: '{print $1}' | sort -u | \
xargs sed -i 's/_scratch_remount/_scratch_cycle_mount/g'

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: add _require_odirect to generic/113 and generic/214
Theodore Ts'o [Thu, 18 Feb 2016 23:44:45 +0000 (10:44 +1100)]
generic: add _require_odirect to generic/113 and generic/214

generic/113 and generic/214 both use O_DIRECT at some stage in their
tests, so check O_DIRECT support before running them.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric: use mount point instead of device name
Hugh Dickins [Thu, 18 Feb 2016 23:44:25 +0000 (10:44 +1100)]
generic: use mount point instead of device name

A tmpfs mount does not involve any block device, its $SCRATCH_DEV is
nothing but a place-holder, so apply 'df' or 'stat' to its mount point
$SCRATCH_MNT instead of to $SCRATCH_DEV.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocommon: _scratch_mkfs_sized() for tmpfs
Hugh Dickins [Thu, 18 Feb 2016 23:44:11 +0000 (10:44 +1100)]
common: _scratch_mkfs_sized() for tmpfs

Enable _scratch_mkfs_sized() for use with tmpfs, so that tests which
use this helper can now run.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agocheck: avoid spurious complaints that tests/$FSTYP/group does not exist
Theodore Ts'o [Thu, 18 Feb 2016 23:43:42 +0000 (10:43 +1100)]
check: avoid spurious complaints that tests/$FSTYP/group does not exist

There are no tmpfs specific tests, so tests/tmpfs does not exist.
This commit avoids printing a spurious error message when running
specifying a group of tests (e.g., "check -g quick"):

  DEVICE: test:/tmp
  MK2FS OPTIONS:
  MOUNT OPTIONS: -o block_validity
  ./check: line 96: tests/tmpfs/group: No such file or directory
  FSTYP         -- tmpfs
  PLATFORM      -- Linux/i686 kvm-xfstests 4.5.0-rc2ext4-00002-g6df2762
  MKFS_OPTIONS  -- test:/scratch
  MOUNT_OPTIONS -- -o size=1G test:/scratch /test/scratch

  generic/001      [10:31:10][    5.811742] run fstests generic/001
      ...

Similar problems have been reported when testing nfs using xfstests.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoext4/001: add output variant for nodelalloc mounts
Theodore Ts'o [Thu, 18 Feb 2016 23:43:34 +0000 (10:43 +1100)]
ext4/001: add output variant for nodelalloc mounts

If the delayed allocation is disabled, we need a slightly different
output for the delayed allocation portion of the tests.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/158: test dedupe with destination offset past EOF
Filipe Manana [Thu, 18 Feb 2016 23:43:04 +0000 (10:43 +1100)]
generic/158: test dedupe with destination offset past EOF

We were testing when the source file offset starts at EOF or beyond,
but not when the destination offset is beyond EOF or when the
destination offset is smaller than EOF but destination offset plus
dedup length is greater than EOF.

This is motivated by a bug in btrfs' extent_same (dedup) ioctl where
we allowed the destination offset to start at EOF and beyond (and
destination offset + length beyond EOF) for the case where the source
and destination files are the same (was not allowed for different
files used as source and destination). This also made the file's
metadata inconsistent when the dedup operation succeeded, which
happened when the source range corresponded to a file hole, prealloc
extent or a data extent filled with zeroes.

The btrfs issue is fixed by the following patch for the linux kernel:

  "Btrfs: fix extent_same allowing destination offset beyond i_size"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
[darrick.wong@oracle.com: fix merge conflicts with latest reflink patchbomb]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoext4: test partial blocksize defrag integrity issue
Eryu Guan [Thu, 18 Feb 2016 23:42:40 +0000 (10:42 +1100)]
ext4: test partial blocksize defrag integrity issue

Calling EXT4_IOC_MOVE_EXTENT on file not aligned with block size and
block size is smaller than page size would cause integrity issue on the
partial-blocksize part when copying data between orign file and donor
file.

This ext4 kernel patch would fix it, titled
"ext4: don't read blocks from disk after extents being swapped in
move_extent_per_page())"

Though this bug only happens in the blocksize smaller than pagesize
case, there's no harm to test on various block size fs, so no block size
is specified in the test, it depends on the test configurations.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoxfs: change return value check to golden image check
Zorro Lang [Thu, 18 Feb 2016 23:41:49 +0000 (10:41 +1100)]
xfs: change return value check to golden image check

xfs/133 and xfs/138 use too much code to do "return value" check,
it's not necessary. For the code can be more readable and clear,
I change "return value" check to golden image check.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agogeneric/072: limit max cpu number to 8
Eryu Guan [Thu, 18 Feb 2016 23:40:56 +0000 (10:40 +1100)]
generic/072: limit max cpu number to 8

Right now generic/072 scales the loop count based on the cpu count. But
on hosts with many cpus(100+), generic/072 runs for hours and generates
very high system load.

Given that the original bug can be reproduced easily on unpatched
kernel, the great number of loops and long run time are not needed. So
limiting the cpu number to 8 (which gives around 20 seconds run time on
my test vm with 8 vcpus) seems reasonable.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
9 years agoaiocp: fix the gcc warnings
Darrick J. Wong [Fri, 12 Feb 2016 17:37:29 +0000 (09:37 -0800)]
aiocp: fix the gcc warnings

Eliminate a debug printf that was causing warnings and fix the other two
debug printfs to avoid tripping on return value warnings.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoreflink: kick the slow tests out of the 'quick' group
Darrick J. Wong [Thu, 11 Feb 2016 23:23:04 +0000 (15:23 -0800)]
reflink: kick the slow tests out of the 'quick' group

Since 'quick' tests are supposed to run in < 15s, kick out the ones
that can't finish that soon even on fast storage.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs: test source CoW across mixed block types with cowextsz set
Darrick J. Wong [Wed, 10 Feb 2016 17:20:45 +0000 (09:20 -0800)]
xfs: test source CoW across mixed block types with cowextsz set

Ensure that we can CoW the source file when the source file consists
of a range of mixed block types and there's a cowextsize hint set.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs: ensure that we don't crash when freeing the ag reservations on a ro mount
Darrick J. Wong [Wed, 10 Feb 2016 07:09:15 +0000 (23:09 -0800)]
xfs: ensure that we don't crash when freeing the ag reservations on a ro mount

Christoph Hellwig discovered that the kernel crashed trying to free
the refcount btree per-ag reservation on a ro mount (because we don't
create the reservation except for rw mounts and ro->rw remounts).  So,
test this to make sure we never do that again. :)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoreflink: test reflink+cow+enospc all at the same time
Darrick J. Wong [Fri, 5 Feb 2016 04:01:41 +0000 (20:01 -0800)]
reflink: test reflink+cow+enospc all at the same time

Set up an impossibly small filesystem and try to reflink and rewrite a
file on it to see what happens when we ENOSPC.  Basically
generic/16[67] but with a constrained fs size.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs: test xfs_getbmapx behavior with shared extents
Darrick J. Wong [Wed, 3 Feb 2016 22:18:25 +0000 (14:18 -0800)]
xfs: test xfs_getbmapx behavior with shared extents

Make sure that xfs_getbmapx behaves properly w.r.t. shared extents
and CoW fork reporting.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs: aio cow tests
Darrick J. Wong [Mon, 1 Feb 2016 23:04:24 +0000 (15:04 -0800)]
xfs: aio cow tests

Test what happens when AIO writes fail when we have a cowextsize hint
set on the files.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoreflink: test aio copy on write
Darrick J. Wong [Tue, 2 Feb 2016 00:01:29 +0000 (16:01 -0800)]
reflink: test aio copy on write

Make sure that copy on write works with the AIO path.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs: test rmapbt functionality
Darrick J. Wong [Fri, 29 Jan 2016 23:01:43 +0000 (15:01 -0800)]
xfs: test rmapbt functionality

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoxfs: test the automatic cowextsize extent garbage collector
Darrick J. Wong [Thu, 28 Jan 2016 23:20:25 +0000 (15:20 -0800)]
xfs: test the automatic cowextsize extent garbage collector

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agoreflink: test CoW across a mixed range of block types with cowextsize set
Darrick J. Wong [Thu, 28 Jan 2016 21:41:24 +0000 (13:41 -0800)]
reflink: test CoW across a mixed range of block types with cowextsize set

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>