Filipe Manana [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
fstests: btrfs, test for send with clone operations
Test that an incremental send operation which issues clone operations
works for files that have a full path containing more than one parent
directory component.
This used to fail before the following patch for the linux kernel:
"[PATCH] Btrfs: send, fix extent buffer tree lock assertion failure"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Christoph Hellwig [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
reflink: change to relative margins
NFS uses 32K blocks and thus the numbers used for sanity checking
various reflink operations are way off. Change to relative margings
and increase them a bit to make NFS happy.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Christoph Hellwig [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
reflink: also treat EINVAL as not supported
This can be returned by various implementations of the ioctl.
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>
Christoph Hellwig [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
xfs/139: fix scratch device filtering
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>
Darrick J. Wong [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
tests: use lowercase variables for all the new reflink tests
Since $TESTDIR is a local variable, make it lowercase to avoid
confusion with $TEST_DIR. While we're at it, make all the local
variables lowercase.
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>
Darrick J. Wong [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
dedupe: record dedupe errors in golden output
The xfs_io dedupe command originally didn't print dedupe errors
to stderr like you'd expect. Since that was fixed, the golden
output should be changed to reflect that.
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>
Darrick J. Wong [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
xfs/122: update against xfsprogs 4.3
Make the xfsprogs sb layout and structure size checker work with
modern xfsprogs (i.e. 4.3+ and all the new v5 stuff). The old test
wasn't picking up structures because they're no longer defined in the
"typedef struct xfs_foo { } xfs_foo_t;" style.
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>
Darrick J. Wong [Sun, 7 Feb 2016 22:27:15 +0000 (09:27 +1100)]
reflink: fix off-by-one errors when iterating file blocks in a loop
When we're iterating file blocks in a loop (via seq), we have to
end at $nr-1, not $nr.
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>
Darrick J. Wong [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
tools/mvtest: call out to the correct group sort program
mvtest should call the actual name of the sort-group program.
Fix a cut-paste error in finding the destination group file.
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>
Eric Sandeen [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
quota: test Q_GETNEXTQUOTA
The new Q_GETNEXTQUOTA quotactl (not yet merged) is designed
to take an ID as input ala Q_GETQUOTA, and return the quota
for the next active ID >= the input ID. This lets us quickly
iterate over all existing quotas by leveraging the kernel's
knowledge of which quotas are allocated and active.
The test contains a new helper binary, test-nextquota, which
tests both the "vfs" and "xfs" versions of the quotactl.
It accepts an ID, and outputs the returned ID, ihard, and
isoft values for that quota. It doesn't return block information
simply because that can vary depending on fs, block size, etc,
and we want something very consistent as output, for verifiation.
The test harness sets quotas for 100 random IDs, remounts,
and uses these quotactls to iterate over all the IDs we set,
using the test binary, making sure we get back what we expect.
Not the prettiest thing, but it works!
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiao Yang [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
fsx.c: Add header file stdbool.h
Compilation failed on RHEL6.7GA because stdbool.h is not included in
xfs/platform_defs-x86_64.h or xfs/linux.h on RHEL6.7GA, so fix it.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
overlay: test copy up files from lower dir
Test copy up files from lower dir that are <, =, > 4G in size.
Kernel commit
0480334fa604 ("ovl: use O_LARGEFILE in ovl_copy_up()")
fixed bug when copying up large file(>4G) from lower dir.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
common: export overlay lower/upper/work directories as variables
This turns hard coded lower/upper/work dir names to configurable
variables.
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>
Eryu Guan [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
common: add overlayfs isupport in _scratch_cleanup_files()
All files in lower/upper dirs should be removed for overlayfs in
_scratch_cleanup_files(), not only files in merged dir, otherwise files
from lower dir won't be removed.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
btrfs: fix test failures after commit
27d077ec0bda
Commit
27d077ec0bda (common: use mount/umount helpers everywhere) made
a few btrfs tests fail (btrfs/003 and btrfs/011). These tests create
filesystems with multiple devices and test the device replace feature,
which need to unmount using the mount path ($SCRATCH_MNT) because
unmounting using one of the devices as an argument ($SCRATCH_DEV) does
not always work - after replace operations we get in /proc/mounts a
device other than $SCRATCH_DEV associated with the mount point
$SCRATCH_MNT (this is mentioned in a comment at btrfs/011 for example),
so we need to pass that other device to the umount program or pass it the
mount point.
Fix this by making _sctatch_unmount() pass $SCRATCH_MNT to umount instead
of $SCRATCH_DEV (when the filesystem being tested is btrfs).
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
new: create a default .out file
Creating a default .out file in "new" to ease the new test creation
process.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
common: no need to parse config file in new
I saw "new" failed the TEST_DEV/SCRATCH_DEV validation when TEST_DEV or
SCRATCH_DEV points to directory, which is needed in overlayfs testing.
"new" only generates test template and doesn't need common/config to
parse and validate TEST_DEV/SCRATCH_DEV etc., so just returns after
setting all needed commands.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
generic/23[23]: some cleanups
1. remove $seqres.full before test
2. no need to check return values of _fsstress and _check_quota_usage
calls, the golden image could catch the failures.
3. remove unused FSX related variables
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jia He [Sun, 7 Feb 2016 22:27:14 +0000 (09:27 +1100)]
common: add names device mounted errors
This adds user friendly prompts to output the already mounted point
from _mount. xfstests will do the cleanup (ie. umount) and user can
not get the mount name information when directory is already
mounted.
Signed-off-by: Jia He <hejianet@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Sun, 7 Feb 2016 22:27:10 +0000 (09:27 +1100)]
fsync-tester: reopen files with correct flags
When "drop caches" tests are run, the test_fd is closed and
re-opened. It is reopened O_RDWR, so dropping O_DIRECT and any other
open flag that was set for test_fd. This fixes a random generic/311
failure due to file data corruption I've been seeing on subtests 11
and 13 when direct IO was specified.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Sun, 7 Feb 2016 22:27:06 +0000 (09:27 +1100)]
check: add exclude sections CLI parameter
When we have a config file with multiple sections, we might want to
exclude certain config sections from running. Rather than specifying
all the section we want to run, add a "-S <section>" option to build
up a list of sections to exclude.
This is useful if a given section config is known to cause a fatal
failure,but you still want to run all the other config sections.
Also add support to the setup program that emits the currently
configured setup for each section in the config file.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Sun, 7 Feb 2016 22:27:05 +0000 (09:27 +1100)]
setup: add section support
Make the setup command section aware so that it is easy to test
whether the section config code is generating the correct
configurations or not.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Tue, 2 Feb 2016 04:54:43 +0000 (15:54 +1100)]
xfs: support realtime/log device setup changes in config sections
Currently changing the devices used by "USE_EXTERNAL" environmental
variable is not supported by the config section parsing. Add the
functionality so that we can use config sections to test external
device configs successfully.
This required tracking down a bug in _check_xfs_filesystem() which
was causing a log device to be passed to a test device without an
external log device. This was caused by an uninitialised variable in
the function. I also added full output file removals to the first
couple of generic tests that were failing, because that's where the
check failure output ends up in this case.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jia He [Mon, 11 Jan 2016 04:13:20 +0000 (15:13 +1100)]
fstests: canonicalize the mount points by removing the trailing "/"
removing all the trailing "/"s of mounting point name by readlink
Suggested-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Jia He <hejianet@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 11 Jan 2016 04:12:20 +0000 (15:12 +1100)]
fstests: btrfs, verify fitrim does not discard reserved device area
Verify that when a fitrim operation is made against a btrfs filesystem,
the ranges [0, 64Kb[ and [68Kb, 1Mb[ of the device are not discarded,
they remain with the content they had before the fitrim operation. These
regions of the device are reserved for a boot loader to use at its will.
In the 4.3 linux kernel we got a regression that allowed a fitrim
operation to discard these reserved ranges of the device, resulting in
the filesystem becoming unbootable after a fitrim. The issue is fixed
by the following patch (targeted for 4.5 and 4.3/4.4 stable releases):
"Btrfs: fix fitrim discarding device area reserved for boot loader's use"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Brian Foster [Mon, 11 Jan 2016 04:11:20 +0000 (15:11 +1100)]
xfs: test XFS torn log write detection
XFS torn log write detection includes a mechanism to inject CRC errors
into log records at runtime and shutdown the fs accordingly. This
ensures that the CRC verification pass on the subsequent mount discovers
an invalid record near the head of the log and considers it a torn
write.
This test runs a workload with error injection enabled and verifies that
the subsequent mount is successful. The test repeats for several
iterations using a random frequency factor for the error event each
time.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiao Yang [Mon, 11 Jan 2016 04:10:20 +0000 (15:10 +1100)]
f2fs: add Makefile for f2fs
Installation failed due to Makefile omission, so fix this.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiong Zhou [Mon, 11 Jan 2016 04:09:20 +0000 (15:09 +1100)]
shared: test mount needs_recovery extN partition with noload option
Once upon a time, ext4 encounter NULL pointer dereference under this
situaiton due to jump to a wrong label. Part of this commit fixed
this Oops:
744692d ext4: use ext4_get_block_write in buffer write
We can also run this test on ext2/3.
This case is based on a script from Monakhov Dmitriy @ openvz.
Cc: Monakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 11 Jan 2016 04:08:20 +0000 (15:08 +1100)]
common/scsi_debug: fix removal of scsi_debug module
Occasionally scsi_debug cannot be removed because it's still in use and
causes xfs/279 to fail.
Now dryrun the removal by modprobe firstly then do the real rmmod.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 11 Jan 2016 04:07:20 +0000 (15:07 +1100)]
fstests: fix cleanup of test btrfs/003
If the test fails after removing a device and before adding it back, it
attempts to add back the device in its _cleanup() function. However this
is broken because the device identifier is stored in a variable local to
the function _test_replace() and not in a global variable. So make the
variable global instead of local.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 11 Jan 2016 04:06:20 +0000 (15:06 +1100)]
fstests: cleanup test btrfs/031
The test was using $SCRATCH_MNT as a mountpoint for $SCRATCH_DEV, which
is counter intuitive and not expected by the fstests framework - this
made the test fail after commit
27d077ec0bda (common: use mount/umount
helpers everywhere). So rewrite the test to use the scratch device for
all data and use a test specific directory inside $TEST_DIR to use as a
mount point for a cross mount of $SCRATCH_DEV.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 11 Jan 2016 04:05:20 +0000 (15:05 +1100)]
fstests: cleanup test btrfs/029
The test was using $SCRATCH_MNT as a mountpoint for $SCRATCH_DEV, which
is counter intuitive and not expected by the fstests framework - this
made the test fail after commit
27d077ec0bda (common: use mount/umount
helpers everywhere). So rewrite the test to use the scratch device for
all data and use a test specific directory inside $TEST_DIR to use as a
mount point for a cross mount of $SCRATCH_DEV.
This test was also overriding $seqres.full, through the redirect ">"
operator, if a call to cp failed. Fix that by using instead the operator
">>". Also make the test use the function _mount() instead of calling
the mount program directly.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Andreas Gruenbacher [Mon, 11 Jan 2016 03:45:26 +0000 (14:45 +1100)]
fsx: Add mechanism to replay failed operations
Create a $name.fsxops file next to $test.fsxlog. When a test fails,
dump the operations in the log into that file in a simple, parseable
format like:
fallocate 0x2e0f2 0xf04a 0x0 keep_size
truncate 0x0 0x11e00 0x0 *
write 0x73400 0x6c00 0x11e00
skip punch_hole 0x71539913 0xdf76 0x7a000 close_open
mapread 0x56000 0x16d08 0x7a000
Here, each operation is on a separate line. When the first word is
"skip", the operation will be skipped. The next parameters are offset,
length, and the current file size, followed by optional flags like
keep_size and clode_open. A trailing asterisk indicates that the
operation overlaps with the operation that has failed.
Add a --replay-ops option that allows to replay the operations recorded
in such a $name.fsxops file. (The log can be modified to easily narrow
down which operations are causing the failure.)
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Andreas Gruenbacher [Mon, 11 Jan 2016 03:45:13 +0000 (14:45 +1100)]
fsx: Improve operation logging
Add FL_SKIPPED, FL_CLOSE_OPEN, and FL_KEEP_SIZE flags to the log
entries. Use FL_SKIPPED to indicate that an operation was skipped. Use
FL_CLOSE_OPEN to encode when an operation is followed by a close/open
cycle. Use FL_KEEP_SIZE to indicate when the OP_ZERO_RANGE and
OP_FALLOCATE operations should keep the file size unchanged and put the
current file size into args[2] so that we can tell which operation was
actually called from the log.
After that, arg2 of log4 is always either unused or the current file size, so
remove it and unconditionally remember the current file size.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Andreas Gruenbacher [Mon, 11 Jan 2016 03:44:51 +0000 (14:44 +1100)]
fsx: Generate test parameters in test()
Generate all test parameters in test(), including keep_size.
The code is slightly more complicated than it could be to produce the
same sequence of operations for the same random seed.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Andreas Gruenbacher [Mon, 11 Jan 2016 03:44:21 +0000 (14:44 +1100)]
fsx: Report number of successful operations
Report the number of successful operations at the end of an fsx run.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Andreas Gruenbacher [Mon, 11 Jan 2016 03:44:05 +0000 (14:44 +1100)]
fsx: Fix hex numbers in operation dump
Some hex numbers are prefixed with "0x" and right-aligned with spaces,
leading to output like "0x beef". Make that "0x0beef" instead.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Andreas Gruenbacher [Mon, 11 Jan 2016 03:43:40 +0000 (14:43 +1100)]
fsx: Small improvements and fixes
Move the run_fsx shell function into common/rc. Fix it to avoid
duplicate output on errors. Write the actual fsx parameters used into
$seqres.full instead of the BSIZE and PSIZE placeholders.
Include the symbolic fallocate mode in fsx error messages instead of the
numeric value. Use fprintf(stderr, ...) instead of warn() when
including strerror(errno) doesn't make sense.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Mon, 21 Dec 2015 07:40:18 +0000 (18:40 +1100)]
common/punch: handle bmap output for unaligned extents
xfs/242 fails if the mapping flags show unaligned extents;
fix up the regexp to allow this, we really only care about
the unwritten flag.
Signed-off-by: eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 21 Dec 2015 07:40:16 +0000 (18:40 +1100)]
generic: create a dedupe group
Create a group for just the deduplication tests.
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>
Darrick J. Wong [Mon, 21 Dec 2015 07:36:26 +0000 (18:36 +1100)]
reflink: test a big CoW operation
Test what happens when we send largeish buffers to CoW all at once.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 21 Dec 2015 07:35:21 +0000 (18:35 +1100)]
reflink: test CoW with blocksize < pagesize
Test CoW operations when blocksize < pagesize and the only reflink
block is in the middle of the page.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 21 Dec 2015 07:27:04 +0000 (18:27 +1100)]
reflink: more CoW tests for reflink and dedupe
These tests examine the behavior of advanced and tricky copy on write
situations.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 21 Dec 2015 07:20:38 +0000 (18:20 +1100)]
reflink: test ENOSPC when expanding btrees during reflink operations
See what happens when we ENOSPC while growing a btree on behalf of
some reflink operation.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 21 Dec 2015 07:13:37 +0000 (18:13 +1100)]
reflink: more tests
Add more tests for unaligned copy-on-write things, and explicitly
test the ability to pass "len == 0" to mean reflink/dedupe all
the way to the end of the file".
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 21 Dec 2015 07:08:15 +0000 (18:08 +1100)]
xfs/129: require loop
Missed a _require_loop for xfs/129.
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>
Darrick J. Wong [Mon, 21 Dec 2015 07:08:12 +0000 (18:08 +1100)]
xfs/128: allow larger margin for disk space usage
The free blocks count can vary from our calculations by up to 8% on a
1k-block filesystem, so permit that.
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>
Darrick J. Wong [Mon, 21 Dec 2015 07:08:01 +0000 (18:08 +1100)]
generic/15[78]: fix error messages in the golden output
Fix the error messages in the golden output for generic/15[78], which
examine the responses to invalid inputs as returned by the
clone/clone_range/extent_same ioctls. Also fix a filtering omission.
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>
Darrick J. Wong [Mon, 21 Dec 2015 07:07:57 +0000 (18:07 +1100)]
tests: don't leave cruft behind on the TEST_MNT
Don't leave cruft behind on the test device's filesystem, so as to
avoid filling it with debris.
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>
Darrick J. Wong [Mon, 21 Dec 2015 07:07:52 +0000 (18:07 +1100)]
test-scripts: test migration scripts
Add two scripts: "nextid" finds the next available test ID number in a
group, and "mvtest" relocates a test, fixes the golden output, and
moves the group entry for that test.
v2: sorting group files should preserve group order; nextid should use
the same algorithm as new; move both tools to tools/.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Eryu Guan [Mon, 21 Dec 2015 07:07:50 +0000 (18:07 +1100)]
generic/079: _notrun if fs doesn't support ioctl
Overlayfs directory inode doesn't support ioctl and reports
"Inappropriate ioctl", so grep for this error message and _notrun if the
message is found.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 21 Dec 2015 07:07:48 +0000 (18:07 +1100)]
generic/062: don't create WHITEOUT_DEV
overlay doesn't support creating WHITEOUT_DEV (major and minor device ID
are both 0). Create null device instead.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 21 Dec 2015 07:07:47 +0000 (18:07 +1100)]
overlayfs: rudimentary test support
Adding basic overlayfs support to fstests, it doesn't test anything
overlayfs specific, but runs existing tests on top of overlayfs. It's
following the path from Eric's patchset and Zab's review back in Mar.
A new fstype "overlay" is added, and TEST_DEV/SCRATCH_DEV are required
to be fs paths, and overlayfs is mounted at TEST_DIR/SCRATCH_MNT, so
tests can be run there.
To test overlayfs, setup config as something like the following
TEST_DEV=/mnt/ovl/test
TEST_DIR=/mnt/testarea/test
SCRATCH_DEV=/mnt/ovl/scratch
SCRATCH_MNT=/mnt/testarea/scratch
then run
./check -overlay -g auto
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Mon, 21 Dec 2015 07:07:43 +0000 (18:07 +1100)]
common: use mount/umount helpers everywhere
Replace every explicit mount/umount of scratch or test devices with
helper functions. This allows the next patch to add in hooks to these
functions in order to set up & tear down overlayfs on every mount/umount
(also adds _test_unmount(), which didn't exist prior)
[Eryu Guan rebased the patch agains latest master and replaced more
mount/umount with helpers]
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Zorro Lang [Mon, 21 Dec 2015 07:07:37 +0000 (18:07 +1100)]
xfs: test user and group quota names beginning with digits
There's a known bug of xfsprogs, when a user or group name beinning
with digits, xfs_quota can't create 'limit' for it.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Zorro Lang [Mon, 21 Dec 2015 07:07:03 +0000 (18:07 +1100)]
xfs: test project quota name beginning with digits
There's a known bug of xfsprogs, when a project name beinning with
digits, it can't be found by run xfs_quota 'quota -p -v ...' command.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiaoguang Wang [Mon, 21 Dec 2015 07:01:54 +0000 (18:01 +1100)]
generic/275: add to the 'enospc' group
Currently we're developing a new in-band deduplication feature for btrfs,
when enabing this feature, it will take much long time to hit the enospc
condition which 275 tries to create. I think 275 is also certain enospc
test and we should add it to 'enospc' group, then we can skip it easily by
excluding 'enospc' group when running fstests.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Jaegeuk Kim [Mon, 21 Dec 2015 07:01:54 +0000 (18:01 +1100)]
f2fs/001: test for -ENOSPC with inline operation
This patch introduces f2fs/001 to test -ENOSPC when inline operation was
activated.
Inline_data feature is described in:
http://lwn.net/Articles/573408/
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jaegeuk Kim [Mon, 21 Dec 2015 07:01:54 +0000 (18:01 +1100)]
common: add mkfs options for f2fs
This patch adds an interface to give mkfs option 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>
Jaegeuk Kim [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
common: support f2fs for _scratch_mkfs_sized
The mkfs.f2fs has an option to build a certain sized filesystem by giving
the number of sectors.
So, this patch adds to use that.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
xfs/293: tighten up checks for documented xfs_io commands
Some commands (like "zero") are simple words which commonly
occur in the manpage text even if they aren't documented as
commands.
Grep for " $COMMAND" instead of the bare word, because
the documented commands show up as indented.
This reveals that the "zero" command is not documented yet.
(It catches "help" too, because it's documented differently;
I'll fix that up in the manpage when I add "zero").
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
xfs/242: remove open-coded check for "zero" command
We have helpers for this, no need to open-code it.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jeff Moyer [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
dmflakey: don't run for dax mounts
There is no sense running dmflakey tests with the dax mount option,
since dmflakey doesn't support it. Mark these as _notrun so that it is
clear that this type of testing is not happenning for dax.
Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jeff Moyer [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
generic/042: remove from the 'auto' group
This test fails 100% of the time for me on xfs and current git head, and
is not run for ext4 since ext4 does not support shutdown. After talking
with bfoster, it isn't expected to succeed right now. Since the auto
group is for tests that *are* expected to succeed, let's move this one
out.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
defrag: loosen input file requirements
We don't have perfect control of file allocation for these tests;
in some cases we may fail to adequately fragment a file prior to
defragmentation testing, and today that will fail the test.
Attack this on 2 fronts:
1) Explicitly allow fewer extents on one of the input files in
generic/018 where the allocator has discretion.
2) _notrun rather than _fail if we don't create enough extents;
this is a defrag test, not an allocator/fragmentation test,
so just skip the test if we can't create an acceptable file
for defrag testing.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jeff Moyer [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
xfs: make sure to _require_attrs when necessary
xfs/073 and xfs/295 forgot to _require_attrs. Fix it.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:47 +0000 (18:01 +1100)]
btrfs/106: work on non-4k page sized machines
This commit makes use of the new _filter_xfs_io_pages_modified filtering
function to print information in terms of page size units rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/103: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/098: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/097: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/095: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/094: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/052: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
filter: filter xfs_io's output in units of page size
The helpers introduced in this commit will be used to make btrfs tests that
assume 4k as the page size to work on non-4k page-sized systems as well.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/096: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/056: to work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified and _filter_od
filtering functions to print information in terms of file blocks rather than
file offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/055: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified and _filter_od
filtering functions to print information in terms of file blocks rather than
file offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:46 +0000 (18:01 +1100)]
btrfs/017: work on non-4k block sized filesystems
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Mon, 21 Dec 2015 07:01:29 +0000 (18:01 +1100)]
filter: Filter xfs_io and od's output in units of FS block size
The helpers introduced in this commit will be used to make btrfs tests that
assume 4k as the block size to work on non-4k blocksized filesystem instances
as well.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Brian Foster [Mon, 21 Dec 2015 07:00:29 +0000 (18:00 +1100)]
xfs: verify invalid metadata LSN detection
XFS v5 superblock fs' use metadata LSN tracking to determine when an
on-disk structure was last written to disk. This is used to ensure log
recovery operates correctly after an unclean shutdown. To work
correctly, the on-disk metadata LSNs must always remain behind the
current LSN with respect to the log.
Historically, xfs_repair had a problem where it incorrectly formats the
log to an LSN that is potentially behind existing metadata LSNs. As
such, xfs_repair and the kernel have been updated to prevent, detect and
recover from the problem. Add a test that intentionally formats the log
incorrectly and verifies that the fs fails to mount and that xfs_repair
detects the invalid metadata LSNs.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Brian Foster [Mon, 21 Dec 2015 06:59:04 +0000 (17:59 +1100)]
xfs: test xfsprogs log formatting infrastructure
The xfsprogs libxfs layer implements its own log formatting code to
support utilities that might need to format the log, such as mkfs,
repair, metadump, etc. This code is fairly independent from kernel log
writing code. Therefore, add a test that reformats the log from
userspace with various supported log stripe unit alignments and verifies
that the end result is a correctly formatted log.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Zhao Lei [Mon, 21 Dec 2015 06:10:32 +0000 (17:10 +1100)]
common: mkfs.btrfs now requires --mixed for small filesystems
generic/077 fails on btrfs progs v4.3:
# ./check generic/077
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 lenovo 4.4.0-rc2_HEAD_1ec218373b8ebda821aec00bb156a9c94fad9cd4_
MKFS_OPTIONS -- /dev/sdb6
MOUNT_OPTIONS -- /dev/sdb6 /var/ltf/tester/scratch_mnt
generic/077 344s ... [failed, exit status 1] - output mismatch (see /var/lib/xfstests/results//generic/077.out.bad)
--- tests/generic/077.out 2015-11-23 17:06:27.
144983112 +0800
+++ /var/lib/xfstests/results//generic/077.out.bad 2015-11-23 17:41:25.
187062895 +0800
@@ -1,7 +1,5 @@
QA output created by 077
*** create filesystem
-*** set default ACL
-*** populate filesystem, pass #1
-*** populate filesystem, pass #2
-*** all done
+mkfs failed
+(see /var/lib/xfstests/results//generic/077.full for details)
*** unmount
Ran: generic/077
Failures: generic/077
Failed 1 of 1 tests
Reason:
btrfs progs v4.3 use non-mixed blockgroup for small volume as default,
it need at least 100M to build a filesystem.
Fix:
Force mixed mode for small-size fs, to make mkfs success.
Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 21 Dec 2015 06:08:46 +0000 (17:08 +1100)]
ext4/001: Select different output based on mount options
Depending on mount options, we handle unwritten extents somewhat
differently. So sometimes we end up zeroing out unwritten extent and
converting it to written one and sometimes we just split it. Choose
expected output based on mount options.
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 21 Dec 2015 06:08:22 +0000 (17:08 +1100)]
common: Improve _link_output_file to be more versatile
Currently _link_output_file() selects output file suffix based on the
current operating system. Make it more versatile by allowing selection
of output file suffix based on any feature string. The idea is that
in config file ($seq.cfg) there are several lines like:
feat1,feat2: suffix
The function is passed a feature string (or uses os_name,MOUNT_OPTIONS
if no argument is passed) and selects output file with a suffix for
which all features are present in the feature string. If there is no
matching line, output with 'default' suffix is selected.
Update all tests using _link_out_file to the new calling convention.
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 21 Dec 2015 06:07:48 +0000 (17:07 +1100)]
common: Factor out function to get OS name
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Zhao Lei [Mon, 21 Dec 2015 06:07:16 +0000 (17:07 +1100)]
generic/081: Support old version of lvm
generic/081 and 108 fails in RHEL 6.3, like:
# ./check generic/081
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 kerneldev 4.2.0-rc5_HEAD_d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754_+
MKFS_OPTIONS -- /dev/vdd
MOUNT_OPTIONS -- /dev/vdd /var/ltf/tester/scratch_mnt
generic/081
[failed, exit status 1] - output mismatch (see /var/lib/xfstests/results//generic/081.out.bad)
--- tests/generic/081.out 2015-07-13 17:07:03.
000000000 +0800
+++ /var/lib/xfstests/results//generic/081.out.bad 2015-10-28 12:20:49.
000000000 +0800
@@ -1,2 +1,3 @@
QA output created by 081
Silence is golden
+ERROR: checking status of /dev/mapper/vg_081-base_081: No such file or directory
Ran: generic/081
Failures: generic/081
Failed 1 of 1 tests
Reason:
Command of "lvm lvcreate --yes" failed because lvm in RHEL 6.3
don't support '--yes' option.
Fix:
Use yes pipe instead '--yes' option for lvm, to make the command
support both new and old version of lvm.
Suggested-by: Dave Chinner <david@fromorbit.com>
Suggested-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 21 Dec 2015 06:05:42 +0000 (17:05 +1100)]
common: Add more checks to _check_dmesg
Teach _check_dmesg to look for improper RCU usage and circular locking
dependency messages. It's useful to check for these as they might point
to a real problem in the filesystem's implementation (or the current
implementation just confuses the checker, probably worth simplifying
the filesystem's implementation).
Currently the test btrfs/071 for example triggers such warnings:
[ 912.924839] ===============================
[ 912.925617] [ INFO: suspicious RCU usage. ]
[ 912.926394] 4.3.0-rc5-btrfs-next-17+ #1 Not tainted
[ 912.927274] -------------------------------
[ 912.928364] fs/btrfs/volumes.c:1977 suspicious rcu_dereference_check() usage!
[ 912.929626]
[ 912.929626] other info that might help us debug this:
[ 912.929626]
[ 912.931197]
[ 912.931197] rcu_scheduler_active = 1, debug_locks = 1
[ 912.933822] 4 locks held by btrfs/6400:
[ 912.934558] #0: (&fs_info->dev_replace.lock_finishing_cancel_unmount){+.+...}, at: [<
ffffffffa046a193>] btrfs_dev_replace_finishing+0x3e/0x696 [btrfs]
[ 912.948929] #1: (uuid_mutex){+.+.+.}, at: [<
ffffffffa046a24a>] btrfs_dev_replace_finishing+0xf5/0x696 [btrfs]
[ 912.950987] #2: (&fs_devs->device_list_mutex){+.+.+.}, at: [<
ffffffffa046a263>] btrfs_dev_replace_finishing+0x10e/0x696 [btrfs]
[ 912.953265] #3: (&fs_info->chunk_mutex){+.+...}, at: [<
ffffffffa046a278>] btrfs_dev_replace_finishing+0x123/0x696 [btrfs]
(...)
[ 912.987973] ======================================================
[ 912.989242] [ INFO: possible circular locking dependency detected ]
[ 912.990583] 4.3.0-rc5-btrfs-next-17+ #1 Not tainted
[ 912.990801] -------------------------------------------------------
[ 912.990801] btrfs/6400 is trying to acquire lock:
[ 912.990801] (&bdev->bd_mutex){+.+.+.}, at: [<
ffffffff8119d202>] __blkdev_get+0xa3/0x3d9
[ 912.990801]
[ 912.990801] but task is already holding lock:
[ 912.990801] (&fs_info->chunk_mutex){+.+.+.}, at: [<
ffffffffa046a278>] btrfs_dev_replace_finishing+0x123/0x696 [btrfs]
[ 912.990801]
[ 912.990801] which lock already depends on the new lock.
[ 912.990801]
[ 912.990801]
[ 912.990801] the existing dependency chain (in reverse order) is:
(...)
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 21 Dec 2015 06:05:03 +0000 (17:05 +1100)]
btrfs/091: fix missing common/reflink include
Commit
20d7bfad2d38 ("reflink: add test support routines to a separate
file") moved the function _require_cp_reflink to the new file
common/reflink but forgot to make btrfs/091 source that file, leading
to the following failure:
$ ./check btrfs/091
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 debian3 4.3.0-rc5-btrfs-next-17+
MKFS_OPTIONS -- /dev/sdc
MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1
btrfs/091 1s ... - output mismatch (see .../results//btrfs/091.out.bad)
--- tests/btrfs/091.out 2015-05-03 01:19:42.
128976975 +0100
+++ .../results/btrfs/091.out.bad 2015-11-18 15:56:35.
332745132 +0000
@@ -1,4 +1,5 @@
QA output created by 091
+./tests/btrfs/091: line 49: _require_cp_reflink: command not found
wrote 262144/262144 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
65536 65536
...
(Run 'diff -u tests/btrfs/091.out .../results/btrfs/091.out.bad' \
to see the entire diff)
So just make btrfs/091 source common/reflink in order to know the
definition of _require_cp_reflink.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 21 Dec 2015 06:03:17 +0000 (17:03 +1100)]
btrfs: test direct IO write against compressed extent
Test that doing a direct IO write against a file range that contains one
prealloc extent and one compressed extent works correctly.
From the linux kernel 4.0 onwards, this either triggered an assertion
failure (leading to a BUG_ON) when CONFIG_BTRFS_ASSERT=y or resulted
in an arithmetic underflow of an inode's space reservation for write
operations.
That issue is fixed by the following linux kernel patch:
"Btrfs: fix extent accounting for partial direct IO writes"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Tue, 17 Nov 2015 03:44:45 +0000 (14:44 +1100)]
generic/269: Fix failure due to race killing fsstress job
When running the test generic/269 against a fast scratch device (loopback
device backed by a file on tmpfs) I often got a test failure due to the
fact that the fsstress job had already completed before the test attempted
to kill it, producing the following failure output:
generic/269 91s ... - output mismatch (see .../generic/269.out.bad)
--- tests/generic/269.out 2014-11-17 20:59:50.
974203000 +0000
+++ /home/fdmanana/git/hub/xfstests/results//generic/269.out.bad 2015-11-13 15:41:59.
669893035 +0000
@@ -3,3 +3,4 @@
Run fsstress
Run dd writers in parallel
+./tests/generic/269: line 59: kill: (13417) - No such process
...
(Run 'diff -u tests/generic/269.out .../generic/269.out.bad' to see the entire diff)
So fix this false failure by redirecting the standard output and error
from the kill into the seq file.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chao Yu [Mon, 16 Nov 2015 21:43:43 +0000 (08:43 +1100)]
generic/285: fix the wrong result printed in full log
This issue was found by testing f2fs module with generic/285, and the
related bug has already been fixed since commit
2e023174a88d ("f2fs:
avoid data offset overflow when lseeking huge file"), but forgot to fix
it in xfstest suit.
The wrong result printed is printed in log below:
10. Test a huge file for offset overflow
10.01 SEEK_HOLE expected 65536 or 0, got 65536. succ
10.02 SEEK_HOLE expected 65536 or 0, got 65536. succ
10.03 SEEK_DATA expected 0 or 0, got 0. succ
10.04 SEEK_DATA expected 1 or 1, got 1. succ
10.05 SEEK_HOLE expected 0 or 0, got 0. FAIL
10.06 SEEK_DATA expected -65536 or -65536, got -65536. succ
10.07 SEEK_DATA expected -65535 or -65535, got -65535. succ
10.08 SEEK_DATA expected -65536 or -65536, got -65536. FAIL
The result printed in the log shows that when some test cases failed, the
data we expected and got are the same that is not correct obviously.
The reason is that we cast the result from type off_t(64-bit) to type
long(32-bit) when doing huge file offset seeking tests in 32-bit machine.
This patch fixes the wrong printing issue.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Justin Maggard [Mon, 16 Nov 2015 21:43:27 +0000 (08:43 +1100)]
btrfs: test quota disable during quota rescan
This test case tests if we are able to disable quotas on a filesystem
while a quota rescan is running. Up to now (4.3) this would result
in a kernel NULL pointer dereference.
Fixed by patch (btrfs: qgroup: fix quota disable during rescan).
Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Justin Maggard [Mon, 16 Nov 2015 21:42:29 +0000 (08:42 +1100)]
btrfs: test unmount during quota rescan
This test case tests if we are able to unmount a filesystem while
a quota rescan is running. Up to now (4.3) this would result
in a kernel NULL pointer dereference.
Fixed by patch (btrfs: qgroup: exit the rescan worker during umount).
Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 16 Nov 2015 21:41:53 +0000 (08:41 +1100)]
ext4/001: Update output
After patch "ext4: Fix races of writeback with punch hole and zero
range" we don't flush range that's going to be zeroed out which results
in different final extent layout because some extents will be zeroed-out
instead of being split. Update the output file accordingly.
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 16 Nov 2015 21:41:44 +0000 (08:41 +1100)]
_filter_fiemap: Avoid awk interval regexps
Older versions of awk do not accept interval regexps by default. Avoid
them in _filter_fiemap to keep better compatibility since it's pretty
trivial.
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 16 Nov 2015 21:41:32 +0000 (08:41 +1100)]
common: add helper function _flakey_drop_and_remount
To avoid having many tests repeating the following pattern:
_load_flakey_table $FLAKEY_DROP_WRITES
_unmount_flakey
_load_flakey_table $FLAKEY_ALLOW_WRITES
_mount_flakey
add the helper function _flakey_drop_and_remount to remove
the existing duplicated code and serve as a shortcut.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 16 Nov 2015 21:41:18 +0000 (08:41 +1100)]
fstests: generic test for fsync after hole punching
Test that a file fsync works after punching a hole for the same file
range multiple times, and that after log/journal replay the file's
content and layout are correct.
This test is motivated by a bug found in btrfs, which is fixed by
the following linux kernel patch:
"Btrfs: fix hole punching when using the no-holes feature"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 16 Nov 2015 21:40:17 +0000 (08:40 +1100)]
reflink: test what happens when we hit resource limits
Add a few horrible opt-in stress tests to see what happens if we try
to reflink the same block billions of times, and what happens if we
run out of space while reflinking a file.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 16 Nov 2015 21:40:08 +0000 (08:40 +1100)]
reflink: test that CoW writes fail when we're out of space
Ensure that copy-on-writing a reflinked file when there's no free disk
space reflects the desired ENOSPC back to userspace during the write
call. Tests the buffered IO, direct IO, and mmap write paths.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 16 Nov 2015 21:40:02 +0000 (08:40 +1100)]
reflink: concurrent operations tests
Make sure that running reflink ops while other IO is ongoing doesn't
break the filesystem.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>