Amir Goldstein [Wed, 27 Sep 2017 07:04:12 +0000 (10:04 +0300)]
overlay: fix _overlay_config_override of MOUNT_OPTIONS
The config variable OVERLAY_MOUNT_OPTIONS is used to configure
the overlay mount options when running ./check -overlay.
The config variable MOUNT_OPTIONS is used to configure the
mount options for base fs.
If config sets value of OVERLAY_MOUNT_OPTIONS and
does not set MOUNT_OPTIONS, the value of MOUNT_OPTIONS
may be leftover from previous _overlay_config_override, so
don't use that value for base fs mount.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 27 Sep 2017 07:04:11 +0000 (10:04 +0300)]
overlay: create helper _overlay_scratch_mount_dirs()
A helper to mount with same options/mnt/dev of scratch mount, but
optionally with different lower/upper/work dirs.
use instead of _overlay_mount_dirs() in all tests where applicable.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 27 Sep 2017 07:04:10 +0000 (10:04 +0300)]
overlay: use default overlay mount options _overlay_mount_dirs()
Tests that use _overlay_mount_dirs() should also use the
default overlay mount options.
Move mount options from overlay_mount() into _overlay_mount_dirs()
and use helper common_dev_mount_opts() to get options.
OVERLAY_MOUNT_OPTIONS is assigned to MOUNT_OPTIONS, so
there is no need to use OVERLAY_MOUNT_OPTIONS directly.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 27 Sep 2017 07:04:09 +0000 (10:04 +0300)]
overlay: remove stale implementation of _scratch_mount_options
_scratch_mount_options() was not implemented correctly for
overlayfs and wasn't used by any overlay tests.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Theodore Ts'o [Sun, 8 Oct 2017 19:27:46 +0000 (15:27 -0400)]
ext4: skip project quota tests if the kernel does not support them
In _scratch_enable_pquota, use _notrun if the file system with project
quotas enable can't be mounted, since that indicates the kernel
doesn't support that feature.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Chandan Rajendra [Sun, 8 Oct 2017 11:25:35 +0000 (16:55 +0530)]
overlay/038: Miscellaneous fixes
This commit removes the redundant chown operation which was supposed to
cause the test file to be copied up. Also, _overlay_scratch_unmount() is
used to unmount the overlay filesystem rather than invoking $UMOUNT_PROG.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Andreas Gruenbacher [Wed, 4 Oct 2017 18:20:09 +0000 (20:20 +0200)]
common/rc: Further improve gfs2 support
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Christoph Hellwig [Wed, 4 Oct 2017 06:16:16 +0000 (08:16 +0200)]
generic: add a new test for racing AIO COW writes
This can be used to trigger an assert in the current XFS code
because it can't handle the case where there are COW extents on a
file, but none at or below the range converted by the AIO completion
handler.
Note that it doesn't trigger the assert 100% but fairly reliably.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Rostislav Skudnov [Fri, 6 Oct 2017 08:25:19 +0000 (08:25 +0000)]
bulkstat_unlink_test_modified: Remove extraneous if statement
Fixes the following compiler warning:
bulkstat_unlink_test_modified.c:171:26: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
if ((ret[i].bs_ino == inodelist[j])) {
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Rostislav Skudnov [Fri, 6 Oct 2017 08:19:46 +0000 (08:19 +0000)]
holetest: Use pid_t type for fork(2) return value
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Rostislav Skudnov [Thu, 5 Oct 2017 12:49:58 +0000 (12:49 +0000)]
writev_on_pagefault: Use ssize_t type for write(2) return value
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Rostislav Skudnov [Thu, 5 Oct 2017 12:49:57 +0000 (12:49 +0000)]
fsstress: Fix wrong size argument to getcwd()
Fixes the following ASAN failure:
==11670==WARNING: AddressSanitizer failed to allocate 0xffffffffffffffff bytes
==11670==AddressSanitizer's allocator is terminating the process instead of returning 0
...
#5 0x4bb230 in __interceptor_malloc /home/vak-local/3.9.1/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:65:10
#6 0x7f97e6491405 in getcwd /build/glibc-6V9RKT/glibc-2.19/io/../sysdeps/unix/sysv/linux/getcwd.c:68
#7 0x454691 in getcwd /home/vak-local/3.9.1/release/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:2822:15
#8 0x4f765d in doproc /.../ltp/fsstress.c:933:12
#9 0x4f5f54 in main /.../ltp/fsstress.c:581:5
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Chandan Rajendra [Fri, 6 Oct 2017 09:29:33 +0000 (14:59 +0530)]
overlay/038: Remove af_unix program requirement
overlay/038 does not use src/af_unix program. This commit removes the
corresponding _require_test_program statement.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Dave Chinner [Tue, 3 Oct 2017 08:21:34 +0000 (19:21 +1100)]
fstests: update mkfs.xfs filters for new refactoring
From: Dave Chinner <dchinner@redhat.com>
The new mkfs code adds some output to indicate where the defaults
were sourced from, so filter that out so it doesn't contaminate
tests unnecessarily.
Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Theodore Ts'o [Mon, 2 Oct 2017 03:39:32 +0000 (23:39 -0400)]
report: fix summary statistics in xUnit header
The xUnit XML DTD distinguishes between test failures and test errors,
where a test failure indicate that the test has explicitly indicated
that the code under test has behaved in an unexpected fashion, whereas
a test error indicates the test code itself has thrown an error or
there has been some other test implementation error.
Xfstest failures are correctly marked as xUnit failures, but in the
attributes of the testsuite XML element, the number of test failures
was incorrectly reported as the number of errors.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Theodore Ts'o [Sat, 30 Sep 2017 03:46:21 +0000 (23:46 -0400)]
report: encode XML Character Entities in xUnit report
Since the xUnit report is an XML document, special XML characters such
as '<', '>', '&', etc. have to be encoded as "<", ">", etc.
Otherwise programs parsing something like this:
<testcase classname="xfstests.global" name="generic/450" time="0">
<skipped message="Only test on sector size < half of block size" />
</testcase>
Will get choke the unescaped '<' character in the skipped message.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Zorro Lang [Fri, 29 Sep 2017 16:49:25 +0000 (00:49 +0800)]
src/nsexec: fix stack pointer alignment exception
When test g/317 or g/318 on ARM server, we got a kernel exception:
kernel: nsexec[8203]: SP Alignment exception: pc=
00000000004010a0 sp=
00000000005200e8
nsexec gives an unaligned child stack address to clone() system
call sometimes. For making sure it's always aligned, use
"__attribute__((aligned))" extension of GCC (Thanks this suggestion
from Eric sandeen).
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 29 Sep 2017 05:37:39 +0000 (22:37 -0700)]
xfs: test increased overlong directory extent discard threshold
As of 2007, metadump has an interesting "feature" where it discards
directory extents that are longer than 1000 (originally 20) blocks.
This ostensibly was to protect metadump from corrupt bmbt records, but
it also has the effect of omitting from the metadump valid long extents.
The end result is that we create incomplete metadumps, which is
exacerbated by the lack of warning unless -w is passed.
So now that we've fixed the default threshold to MAXEXTLEN, check that
the installed metadump no longer exhibits this behavior.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Fri, 29 Sep 2017 04:05:41 +0000 (12:05 +0800)]
common/xfs: add iomap_dio_complete() to the dmesg filter
Kernel commit
332391a9935d ("fs: Fix page cache inconsistency when mixing
buffered and AIO DIO") moved the WARN_ON_ONCE() into iomap_dio_complete(),
along with the page cache invalidation. Let's add iomap_dio_complete() to the
filter whitelist too, so this expected warning when mixing direct I/O with
buffered I/O won't fail tests.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 28 Sep 2017 16:40:41 +0000 (19:40 +0300)]
generic/447: not a quick test
It hogged my cpu for a good 300s.
Test was inheritted from generic/176, which is not quick.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Xiong Zhou [Thu, 28 Sep 2017 07:41:39 +0000 (15:41 +0800)]
generic: mmap write readonly DAX file
Regression case that one can write to read-only
file in a DAX mountpoint.
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Xiong Zhou [Thu, 28 Sep 2017 07:41:38 +0000 (15:41 +0800)]
gitignore: sort src/ binaries name
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Xiong Zhou [Thu, 28 Sep 2017 07:41:37 +0000 (15:41 +0800)]
tests: add new group dax
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Liu Bo [Wed, 27 Sep 2017 16:35:51 +0000 (10:35 -0600)]
btrfs: regression test for reading compressed data
We had a bug in btrfs compression code which could end up with a
kernel panic.
This is adding a regression test for the bug and I've also sent a
kernel patch to fix the bug.
The patch is "Btrfs: fix kernel oops while reading compressed data".
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 27 Sep 2017 01:04:19 +0000 (18:04 -0700)]
generic/45[34]: fix the xfs_scrub probe test
We changed the name of the xfs_scrub verb from 'test' to 'probe', so
fix xfstests to follow.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Khazhismel Kumykov [Fri, 22 Sep 2017 20:10:47 +0000 (13:10 -0700)]
generic: Add nocheck shutdown stress test
Most shutdown tests only run on filesystems with metadata
journaling, so we lose coverage. Add a shutdown stress test that
doesn't check for consistency, so does not require journaling. This
is a modified version of generic/051, with some extras trimmed and
fs checking removed.
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Richard Wareing [Fri, 22 Sep 2017 02:34:46 +0000 (19:34 -0700)]
xfs: Add test for CVE-2017-14340
Verify kernel doesn't panic when user attempts to set realtime flags
on non-realtime FS, using kernel compiled with CONFIG_XFS_RT.
Unpatched kernels will panic during this test. Kernels not compiled
with CONFIG_XFS_RT should pass test.
This bug was fixed via commit
b31ff3cdf540 ("xfs:
XFS_IS_REALTIME_INODE() should be false if no rt device present") on
the main kernel tree.
[eguan: don't assume fixed position when grepping 't' and add some
comments about why we do this, also remove testfile after test]
Signed-off-by: Richard Wareing <rwareing@fb.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Tue, 19 Sep 2017 11:39:44 +0000 (14:39 +0300)]
overlay/031: fix test with inodes index enabled
When overlayfs is configured with CONFIG_OVERLAY_FS_INDEX=y,
workdir from previous overlay mount cannot be reused in a new
overlay mount that uses a different upper dir.
Fix the test to use a different workdir when mounting with a
different upper dir.
This change has no effect on older kernels and overlay
configured without CONFIG_OVERLAY_FS_INDEX.
Cc: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Tue, 19 Sep 2017 11:39:43 +0000 (14:39 +0300)]
overlay/014: correct comment relating to workdir reuse
Clarification: EBUSY is what you get when trying to use the same
upperdir/workdir with two different *concurent* overlayfs mounts.
The EBUSY case is independent of the inodes index feature.
This is not the case in this test, but rather the case of trying to
reuse the same workdir with different upper dirs on *subsequent*
overlayfs mounts.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Andreas Gruenbacher [Sat, 16 Sep 2017 13:20:54 +0000 (15:20 +0200)]
common/rc: Improve gfs2 support
Support gfs2 in _scratch_mkfs_sized _scratch_mkfs_blocksized.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Christoph Hellwig [Sun, 3 Sep 2017 15:51:01 +0000 (17:51 +0200)]
xfs/310: relax extent count check
If we got over the bmbt length we'll always allocate two extents,
its just that so far getbmap merged them.
Also fix/update some comments.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Fri, 15 Sep 2017 10:47:28 +0000 (13:47 +0300)]
overlay/038: fix impure xattr test
On kvm-xfstest, getfattr (2.4.43) does not return failure exit code
when the requested xattr is not found.
Change the test to check the returned xattr value instead of exit
code.
Cc: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
xiao yang [Mon, 18 Sep 2017 01:29:00 +0000 (09:29 +0800)]
xfs/115: add missing 115 into group file
Signed-off-by: xiao yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
zhangyi (F) [Thu, 14 Sep 2017 13:27:07 +0000 (21:27 +0800)]
overlay: test chattr lower file in overlay
chattr with [iap..] attributes open file for read-only and invoke
ioctl(). If we chattr a lower file in overlay, it will get the lower
file but not trigger copy-up, so ioctl() lead to modification of
that lower file incorrectly. Add this test for this case.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
zhangyi (F) [Thu, 14 Sep 2017 12:04:02 +0000 (20:04 +0800)]
overlay: test relatime for directories
Add test access time update issue for directories in upper layer.
Upstream commit
cd91304e7190 ("ovl: fix relatime for directories")
fixed this issue.
[eguan: add atime group]
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Jeff Layton [Wed, 13 Sep 2017 13:06:24 +0000 (09:06 -0400)]
src/fsync-err: write to different offset on each fd
NFS currently has slightly different semantics from other fs' and
fails this test due to the fact that the same range is overwritten
via each fd.
Change it so that each fd overwrites a different region, which is
more representative of a real workload anyway.
Reported-by: Neil Brown <neilb@suse.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Mon, 4 Sep 2017 09:38:19 +0000 (17:38 +0800)]
generic: reserve correct indirect blocks for delalloc write path
Test that XFS reserves reasonable indirect blocks for delalloc and
speculative allocation, and doesn't cause any fdblocks corruption.
This was inspired by an XFS but that too large 'indlen' was returned by
xfs_bmap_worst_indlen() which can't fit in a 17 bits value
(STARTBLOCKVALBITS is defined as 17), then leaked 1 << 17 blocks in
sb_fdblocks.
This was only seen on XFS with rmapbt feature enabled, but nothing
prevents the test from being a generic test.
Reviewed-by: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Carlos Maiolino [Fri, 18 Aug 2017 08:51:56 +0000 (10:51 +0200)]
xfs: Test infinite loop while searching for a free inode slot
Tests the search algorithm for a free inode slot in a specific AG,
done in xfs_dialloc_ag_inobt().
When finobt is not used, and agi->freecount is not 0, XFS will scan
the AG inode tree looking for a free inode slot, but if
agi->freecount is corrupted, and there is no free slot at all, it
will end up in an infinite loop.
This test checks for the infinite loop fix.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Carlos Maiolino [Fri, 18 Aug 2017 08:51:55 +0000 (10:51 +0200)]
common/xfs: Add helpers for checking CONFIG_XFS_DEBUG availability
Add the following helpers to common/xfs:
_require_xfs_debug()
_require_no_xfs_debug()
Tests that require or not a kernel built with XFS_DEBUG can now use
these two helpers to explicitly check for it.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Carlos Maiolino [Thu, 13 Jul 2017 13:12:08 +0000 (15:12 +0200)]
generic: Test filesystem lockup on full overprovisioned dm-thin
With thin devices, it's possible to have a virtual device larger
than the physical device itself, and such situation can cause
problems to filesystems, once the filesystem 'believe' to have more
space than it actually has.
This can lead the filesystem to several weird behaviors. The one
tested here is filesystem lockup.
In case of XFS, it locks up when trying to writeback AIL metadata
back to the filesystem, but, once there is no physical space
available, XFS locks up and do not gracefuly handle this case.
Other filesystems usually are remounted as read-only, so they
already have this situation covered.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ross Zwisler [Tue, 12 Sep 2017 04:45:19 +0000 (22:45 -0600)]
gitignore: ignore cscope files
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Fri, 8 Sep 2017 04:34:42 +0000 (12:34 +0800)]
generic: renumber tests after merge
Tests were merged with high seq numbers to avoid conflicts with
other tests. Now renumber them to contiguous numbers, as all other
tests have been merged correctly. This is easier to do than
assigning the final seq numbers at commit time.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:13 +0000 (13:03 +0300)]
generic: regression test for xfs leftover CoW extent error
The following error are reported after running this test:
*** xfs_check output ***
leftover CoW extent (0/
2147483736) len 1
block 0/
2147483736 out of range
blocks 0/
2147483736..
2147483736 claimed by block 0/6
leftover CoW extent (0/
2147483738) len 2
blocks 0/
2147483738..
2147483739 out of range
blocks 0/
2147483738..
2147483739 claimed by block 0/6
leftover CoW extent (0/
2147483741) len 3
blocks 0/
2147483741..
2147483743 out of range
blocks 0/
2147483741..
2147483743 claimed by block 0/6
block 0/88 type unknown not expected
block 0/90 type unknown not expected
block 0/91 type unknown not expected
block 0/93 type unknown not expected
block 0/94 type unknown not expected
block 0/95 type unknown not expected
*** xfs_repair -n output ***
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
leftover CoW extent (0/88) len 1
leftover CoW extent (0/90) len 2
leftover CoW extent (0/93) len 3
- found root inode chunk
This should be fixed by patch titled:
xfs: evict CoW fork extents when performing finsert/fcollapse
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:12 +0000 (13:03 +0300)]
generic: crash consistency fsx test for cloned files
[eguan: fixed minor code style issues, remove extra newline at eof]
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:11 +0000 (13:03 +0300)]
generic: regression test for ext4 crash consistency bug
This test is motivated by this inconsistency found in ext4 during random
crash consistency tests:
*** fsck.ext4 output ***
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
Pass 1: Checking inodes, blocks, and sizes
Inode 12, end of extent exceeds allowed value
(logical block 33, physical block 33817, len 7)
Clear? no
Inode 12, i_blocks is 240, should be 184. Fix? no
This test uses device mapper flakey target to demonstrate the bug
found using device mapper log-writes target.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:10 +0000 (13:03 +0300)]
generic: crash consistency fsx test using dm-log-writes
Cherry-picked the test from commit
70d41e17164b
in Josef Bacik's fstests tree (https://github.com/josefbacik/fstests).
Quoting from Josef's commit message:
The test just runs some ops and exits, then finds all of the good buffers
in the directory we provided and:
- replays up to the mark given
- mounts the file system and compares the md5sum
- unmounts and fsck's to check for metadata integrity
dm-log-writes will pretend to do discard and the replay-log tool will
replay it properly depending on the underlying device, either by writing
0's or actually calling the discard ioctl, so I've enabled discard in the
test for maximum fun.
[Amir:]
- Removed unneeded _test_falloc_support dynamic FSX_OPTS
- Fold repetitions into for loops
- Added place holders for using constant random seeds
- Add pre umount checkpint
- Add test to new 'replay' group
- Address review comments by Eryu Guan
[eguan: fixed minor code style issues, remove extra newline at eof]
Cc: Josef Bacik <jbacik@fb.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:09 +0000 (13:03 +0300)]
fstests: add support for working with dm-log-writes target
Cherry-picked the relevant common bits from commit
70d41e17164b
in Josef Bacik's fstests tree (https://github.com/josefbacik/fstests).
Quoting from Josef's commit message:
This patch adds the supporting code for using the dm-log-writes
target. The dmlogwrites code is similar to the dmflakey code, it just
gives us functions to build and tear down a dm-log-writes target. We
add a new LOGWRITES_DEV variable to take in the device we will use as
the log and add checks for that.
[Amir:]
- Removed unneeded _test_falloc_support
- Moved _require_log_writes to dmlogwrites
- Document _require_log_writes
- Address review comments by Eryu Guan
Cc: Josef Bacik <jbacik@fb.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:08 +0000 (13:03 +0300)]
replay-log: add support for replaying ops in target device sector range
Using command line options --start-sector and --end-sector, only
operations acting on the specified target device range will be
replayed.
Single vebbose mode (-v) prints out only replayed operations.
Double verbose mode (-vv) prints out also skipped operations.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:07 +0000 (13:03 +0300)]
replay-log: add validations for corrupt log entries
Check for all zeros entry and for non zero padded entry
and report log offset of corrupted log entry.
Also report log offsets with -v and -vv debug prints.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 10:03:06 +0000 (13:03 +0300)]
log-writes: add replay-log program to replay dm-log-writes target
Imported Josef Bacik's code from:
https://github.com/josefbacik/log-writes.git
Specialized program for replaying a write log that was recorded by
device mapper log-writes target. The tools is used to perform
crash consistency tests, allowing to run an arbitrary check tool
(fsck) at specified checkpoints in the write log.
[Amir:]
- Add project Makefile and SOURCE files
- Document the replay-log auxiliary program
- Address review comments by Eryu Guan
Cc: Josef Bacik <jbacik@fb.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 07:26:38 +0000 (10:26 +0300)]
fsx: add support for keeping existing file
With fsx -k, do not truncate existing file and use its size as upper
bound on file size.
This is needed to prevent fsx from truncating the file on start of
test when testing fsx on cloned files.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 07:26:37 +0000 (10:26 +0300)]
fsx: add support for writing constant instead of random data
-g X: write character X instead of random generated data
This is useful to compare holes between good and bad files
because hexdump of good and bad files compacts the contigious
ranges of X and zeroes.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 07:26:36 +0000 (10:26 +0300)]
fsx: add support for recording operations to a file
Usually, fsx dumps an .fsxops file on failure with same basename
as work file and possibly under dirctory specified by -P dirpath.
The --record-ops[=opsfile] flag can be use to dump ops file also
on success and to optionally specify the ops file name.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 07:26:35 +0000 (10:26 +0300)]
fsx: add optional logid prefix to log messages
When redirecting the intermixed output of several fsx processes
to a single output file, it is usefull to prefix debug log messages
with a log id. Use fsx -j <logid> to define the log messages prefix.
Fix implementation of prt() function to avoid using a temp buffer
and convert some more printf() calls to use ptr() instead.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Thu, 7 Sep 2017 07:26:34 +0000 (10:26 +0300)]
fsx: add support for integrity check with dm-log-writes target
Cherry-picked the relevant fsx bits from commit
70d41e17164b
in Josef Bacik's fstests tree (https://github.com/josefbacik/fstests).
Quoting from Josef's commit message:
I've rigged up fsx to have an integrity check mode. Basically it works
like it normally works, but when it fsync()'s it marks the log with a
unique mark and dumps it's buffer to a file with the mark in the filename.
I did this with a system() call simply because it was the fastest. I can
link the device-mapper libraries and do it programatically if that would
be preferred, but this works pretty well.
Signed-off-by: Josef Bacik <jbacik@fb.com>
[Amir:]
- Fix some exit codes
- Require -P dirpath for -i logdev
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Chandan Rajendra [Sun, 3 Sep 2017 13:13:09 +0000 (18:43 +0530)]
overlay: Test constant d_ino feature
This commit adds a test to verify constant d_ino feature. The
following scenarios are checked,
- Parent's (i.e. "..") d_ino must always be calculated because a
pure dir can be residing inside a merged dir.
- d_ino for "." must always be calculated because the present
directory can have a copy-up origin.
- Verify d_ino of '.' and '..' before and after dir becomes impure.
While at it also verify if trusted.overlay.impure xattr is
set/reset appropriately and invalidation of readdir cache.
- Verify copied up file's (inside a impure dir) d_ino.
- Verify d_ino values corresponding to "." and ".." entries of a
pure lower dir.
- Verify d_ino of ".." entry of a merged dir.
- Verify pure lower residing in dir which has another lower layer
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Misono, Tomohiro [Fri, 1 Sep 2017 05:39:44 +0000 (14:39 +0900)]
fstests: filter test and scratch together safely
Several tests uses both _filter_test_dir and _filter_scratch
concatenated by pipe to filter $TEST_DIR and $SCRATCH_MNT. However,
this would fail if the shorter string is a substring of the other
(like "/mnt" and "/mnt2").
This patch introduces new common filter function to safely call both
_filter_test_dir and _filter_scratch, and update tests and functions
to use this new function.
I checked this with btrfs/029, generic/409,410,411, and
generic/381,383, xfs/106,108 (which calls _filter_quota). Thanks
Eryu for advice.
[eguan: folded 2nd patch into 1st patch and update commit log a bit]
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 30 Aug 2017 22:52:34 +0000 (15:52 -0700)]
generic: try various unicode normalization games
Linux filesystems generally treat filenames and extended attribute
keys as a bag of bytes, which means that there can be unique
sequences of bytes that render the same on most modern GUIs. So,
let's rig up a test to see if it's really true that we can create
filenames and xattrs that look the same but point to different
files. xfs_scrub will warn about these kinds of situations, though
they're not technically fs "corruption".
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Thu, 31 Aug 2017 14:47:41 +0000 (07:47 -0700)]
xfs: test rmapbt updates are correct with insert/collapse range
Make sure that we update the rmapbt correctly when we collapse-range
a file and the extents on both sides of the hole can be merged. We
can construct this pretty trivially with insert-range and write, so
test that too.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 30 Aug 2017 22:32:03 +0000 (15:32 -0700)]
xfs/122: fix the size of fsop_ag_resblks structure
The size of the structure used to retrieve per-AG reserved blocks
status has changed (it's not in a released upstream), so update
xfs/122.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 30 Aug 2017 22:31:41 +0000 (15:31 -0700)]
common/rc: fix xfs_io scrub command existence test
The name of the xfs_io scrub subcommand to test for the existence of
the ioctl has been changed to 'test' from 'dummy', so fix xfstests.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 30 Aug 2017 22:31:10 +0000 (15:31 -0700)]
generic/173: don't dump core when mwrite fails
In generic/173, we try to force a CoW to a mmap'd region to fail if
there's no space to actually stage the CoW operation. That failure
comes in the form of a SIGBUS to xfs_io. If the tester just happens
to have a nonzero coresize ulimit set, a core dump is generated and
the test is marked as having failed, even though the dump generation
is exactly the correct behavior.
Therefore, set the coresize ulimit to zero while calling
_mwrite_byte.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Zorro Lang [Thu, 31 Aug 2017 05:59:43 +0000 (13:59 +0800)]
fsstress: fallback to block size for min dio size
XFS_IOC_DIOINFO is only used for XFS, but fsstress use it to get
DIO aligned size. If XFS_IOC_DIOINFO returns error, then stop
doing any DIO related test (dread/dwrite/aread/awrite etc). That
means we never do DIO related test on other filesystems by fsstress.
The real minimal dio size is really not so important for DIO test
in fsstress. The multiple of real min dio size is fine too. I think
the stat.st_blksize get from stat() system call can be used to be
a fake minimal dio size, if XFS_IOC_DIOINFO fails (not supported).
Note that the equation about d_maxiosz is copied from kernel
XFS_IOC_DIOINFO ioctl source code:
case XFS_IOC_DIOINFO: {
...
da.d_mem = da.d_miniosz = target->bt_logical_sectorsize;
da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1);
...
}
[eguan: update commit log add d_maxiosz reference]
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ross Zwisler [Thu, 31 Aug 2017 04:09:10 +0000 (22:09 -0600)]
generic: add test for executables on read-only DAX mounts
This adds a regression test for the following kernel patch:
commit
42d4a99b09cb ("ext4: fix fault handling when mounted with -o
dax,ro")
The above patch fixes an issue with ext4 where executables cannot be
run on read-only filesystems mounted with the DAX option.
This issue does not appear to be present in ext2 or XFS, as they
both pass the test. I've also confirmed outside of the test that
they are both indeed able to execute binaries on read-only DAX
mounts.
Thanks to Randy Dodgen for the bug report and reproduction steps.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Randy Dodgen <rdodgen@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 30 Aug 2017 14:51:37 +0000 (17:51 +0300)]
fsx: fix compile warnings
[eguan: fix conflicts with patch "fsx: Fix -Wformat-security
warnings"]
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 30 Aug 2017 04:40:56 +0000 (21:40 -0700)]
xfs/013: exit cleaner thread if fsstress dies
In this test, the cleaner thread deletes the directory trees created
by fsstress in order to exercise the free inode btree code.
However, if fsstress dies, the cleaner can end up waiting forever
for a directory that will never be created, which hangs up the test
run. Therefore, abort if fsstress has ended.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Wed, 30 Aug 2017 04:40:50 +0000 (21:40 -0700)]
xfs/{319,323}: don't checksum files after log recovery
These two tests simulate log failure during a reflink operation.
However, the contents of the target of the reflink operation depend
on the block size, so we cannot hardcode md5 hashes in this test.
Since the whole point of the test is to ensure that the the complex
chain of transactions actually finishes no matter where the
interruption, it is sufficient simply to run the usual end-of-test
fsck to look for corrupt metadata.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Zorro Lang [Wed, 30 Aug 2017 06:26:45 +0000 (14:26 +0800)]
xfs/095: require 512b sector size SCRATCH_DEV
xfs/095 fails on 4k hard sector size device, due to it runs:
_mkfs_log "-l version=1 -m crc=0 -d sectsize=512"
So _notrun if SCRATCH_DEV's sector size is bigger than 512b.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Tuomas Tynkkynen [Tue, 29 Aug 2017 13:37:14 +0000 (16:37 +0300)]
fsx: Fix -Wformat-security warnings
Some distros (NixOS) have their build environment enable
-Werror=format-security by default for security/hardening reasons.
Currently fsx fails to build due to this:
fsx.c: In function 'prt':
fsx.c:215:18: error: format not a string literal and no format arguments [-Werror=format-security]
fprintf(stdout, buffer);
^
fsx.c:217:20: error: format not a string literal and no format arguments [-Werror=format-security]
fprintf(fsxlogf, buffer);
^
Indeed the compiler is correct here, if the message-to-be-printed were
to contain a '%', unpredictable things would happen. Fix this.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Tuomas Tynkkynen [Tue, 29 Aug 2017 13:37:13 +0000 (16:37 +0300)]
src/t_mtab: Add newlines to error messages
I can't recall anymore what exactly I did to have tests using t_mtab
to fail, but nevertheless this commit adds the proper newlines.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 23 Aug 2017 15:49:13 +0000 (18:49 +0300)]
fsx: fix path of .fsx* files
When command line arg -P <dirpath> is used, compose the
path for .fsxgood .fsxlog .fsxops files from dirpath and
work file basename.
This fix is ported from LTP.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 23 Aug 2017 15:49:12 +0000 (18:49 +0300)]
fsx: fixes to random seed
Not sure why, but with initstate()/setstate(), fsx generates
same events regadless of the input seed argument.
Change to use srandom() to fix the problem.
Add pid to auto random seed, so parallel fsx executions with auto
seed will use different seed values.
At this time there are 6 tests that use fsx, out of which:
2 use -S 0 as seed (gettime()) - generic/{075,112}
2 do not specify seed (default = 1) - generic/{091,263}
1 uses explicit constant seed - generic/127
1 uses explicit $RANDOM seed - generic/231
This change affects all those tests.
The tests that intended to randomize the seed will now really
randomize the seed.
The tests that intended to use a constant seed will still use
a constant seed, but resulting event sequence will be different
than before this change.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 23 Aug 2017 15:49:11 +0000 (18:49 +0300)]
common/rc: fix _require_xfs_io_command params check
When _require_xfs_io_command is passed command parameters,
the resulting error from invalid parameters may be ignored.
For example, the following bogus params would not abort the test:
_require_xfs_io_command "falloc" "-X"
_require_xfs_io_command "fiemap" "-X"
Fix this by looking for the relevant error message.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Wed, 23 Aug 2017 15:49:10 +0000 (18:49 +0300)]
common/rc: convert some egrep to grep
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Zorro Lang [Sat, 26 Aug 2017 13:26:36 +0000 (21:26 +0800)]
generic: test data integrity with mixed buffer read and aio dio write
When mixing buffered reads and asynchronous direct writes, it is
possible to end up with the situation where we have stale data in
the page cache while the new data is already written to disk.
This issue should be fixed by patch titled:
fs: Fix page cache inconsistency when mixing buffered and AIO DIO
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ilya Dryomov [Fri, 25 Aug 2017 12:04:41 +0000 (14:04 +0200)]
generic/420: truncate testfile before executing the test
If generic/437 is run before generic/420, the latter fails with:
4c4
< stat.size = 2048
---
> stat.size =
2097152
because both use $TEST_DIR/testfile. generic/437 leaves it at 2M,
while generic/420 assumes that it is empty (or at least smaller than
2048 bytes).
Use a private test file (testfile.$seq) and truncate it on open just in
case.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ilya Dryomov [Thu, 24 Aug 2017 12:48:26 +0000 (14:48 +0200)]
generic/108: tolerate old lvm utility versions
lvm utility in Ubuntu 14.04 LTS treats -l 100%FREE as a hard number
and not as an approximate upper limit. With ~5G scratch partition
and ~128M scsi_debug device, vg_108 is 1279+31=1310 extents long,
but only 31*2=62 can be allocated with -i 2:
# lvm lvcreate -i 2 -I 4m -l 100%FREE -n lv_108 vg_108
Insufficient suitable allocatable extents for logical volume lv_108: 1248 more required
lvm2 commit
4b6e3b5e5ea6 ("allocation: Allow approximate
allocation when specifying size in percent") made '-l 100%FREE'
possible when creating RAID LVs or setting number of stripes.
Fix it by setting the size to allocate to 100M, which is enough for
the test with 128M scsi_debug device.
[eguan: update commit log a bit to mention the lvm2 commit that
changed the lvcreate behavior]
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ilya Dryomov [Thu, 24 Aug 2017 14:17:38 +0000 (16:17 +0200)]
fstests: don't _require_metadata_journaling before _scratch_mkfs
This is obviously wrong and makes ./check -r skip over tests on ext4
with "ext4 on $DEV not configured with metadata journaling".
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 21 Jul 2017 22:04:58 +0000 (15:04 -0700)]
xfs: test fuzzing every field of a dquot
See what happens when we fuzz every field of a quota information structure.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 21 Jul 2017 22:04:52 +0000 (15:04 -0700)]
common/populate: enable xfs quota accounting
When we're creating a populated xfs image, turn on quotas so that we can
fuzz those fields too.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Sat, 19 Aug 2017 15:46:45 +0000 (08:46 -0700)]
xfs: test xfs_db fuzz command verbs
Ensure that the fuzz command does what it says.
[eguan: fixed test failures on non-CRC XFS]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 18 Aug 2017 20:52:28 +0000 (13:52 -0700)]
common/fuzzy: fix fuzz verb scanning
As part of upstreaming, the xfs_db fuzz command change the help output
which breaks the fuzzers' ability to detect fuzz verbs. Fix that.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Brian Foster [Wed, 2 Aug 2017 16:36:13 +0000 (12:36 -0400)]
xfs: test for log recovery failure after tail overwrite
XFS is susceptible to log recovery problems if the fs crashes under
certain circumstances. If the tail has been pinned for long enough
to the log to fill and the next batch of log buffer submissions
happen to fail, the filesystem shuts down having potentially
overwritten part of the range between the last good tail->head range
in the log. This causes log recovery to fail with crc mismatch or
invalid log record errors.
Add a test that uses XFS DEBUG mode error injection to force the
tail overwrite condition with a known bad (crc mismatch) log write
and tests that log recovery succeeds. Note that this problem is
currently only reproducible with larger (non-default) log buffer
sizes (i.e., '-o logbsize=256k') or smaller block sizes (1k).
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Amir Goldstein [Tue, 15 Aug 2017 10:31:30 +0000 (13:31 +0300)]
overlay: test mount error cases with index=on
- Upper/lower mismatch
- Index/upper mismatch
With index=on, lowerdir and upperdir are verified using a file
handle stored in trusted.overlay.origin xattr in upperdir and
indexdir.
Failure to verify lowerdir/upperdir on mount results in ESTALE.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Lu Fengqi [Mon, 14 Aug 2017 07:03:13 +0000 (15:03 +0800)]
btrfs/142: enhance regression test for nocsum dio read's repair
I catch this following error from dmesg when this testcase fails.
[17446.661127] Buffer I/O error on dev sdb1, logical block 64, async page read
We expect to inject disk IO errors on the device when xfs_io reads
the specific file, but other processes may trigger IO error earlier.
So, we can use task-filter to solve this problem.
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Filipe Manana [Thu, 10 Aug 2017 21:55:40 +0000 (22:55 +0100)]
btrfs: test incremental send with compression and extent cloning
Test that an incremental send/receive operation will not fail when the
destination filesystem has compression enabled and the source filesystem
has a 4K extent at a file offset 0 that is not compressed and that is
shared.
This currently fails on btrfs and is fixed by the following patch for the
linux kernel:
"Btrfs: incremental send, fix emission of invalid clone operations"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Xiao Yang [Fri, 4 Aug 2017 07:08:45 +0000 (15:08 +0800)]
xfs/424: add check for finobt && update comments
1) This test can check if setting types causes error regardless of
supporting crc, so we can update existed comments about it. We
also add new comments about known issues triggered in this test.
2) When finobt is disabled, xfs_db fails to get current address of
free_root, as below:
xfs_db -c "agi" -c "addr free_root" -c "daddr" /dev/sda11
Metadata CRC error detected at xfs_inobt block 0x0/0x1000
...
Running related tests without finobt makes no sense, so we add
check for finobt.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Zorro Lang [Thu, 3 Aug 2017 14:22:25 +0000 (22:22 +0800)]
generic: test read around EOF
As posix standard, if the file offset is at or past the end of file,
no bytes are read, and read() returns zero. There was a bug, when
DIO read offset is just past the EOF a little, but in the same block
with EOF, read returns different negative values.
Kernel commit
74cedf9b6c60 ("direct-io: Fix negative return from dio
read beyond eof") and commit
2d4594acbf6d ("fix the regression from
"direct-io: Fix negative return from dio read beyond eof"") fixed
the bug.
This case reads from range within EOF, past EOF and at EOF, to make
sure the return value as expected, especially read from past/at EOF
returns 0.
[eguan: update commit log and comments about information of the
specific bug, adjust read_test param order (offset, count, ret) and
test description]
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ernesto A. Fernández [Wed, 9 Aug 2017 02:33:58 +0000 (23:33 -0300)]
generic/307: add test to acl group
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 4 Aug 2017 15:37:07 +0000 (08:37 -0700)]
common/inject: refactor helpers to use new errortag interface
Refactor the XFS error injection helpers to use the new errortag
interface to configure error injection. If that isn't present, fall
back either to the xfs_io/ioctl based injection or the older sysfs
knobs. Refactor existing testcases to use the new helpers.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Xiao Yang [Mon, 31 Jul 2017 09:36:56 +0000 (17:36 +0800)]
common/config: add acl and user_xattr support for TEST_DEV
On RHEL6.9GA, generic/097 fails for ext4 because _test_cycle_mount()
remount ext4 without the user_xattr option, so extended attributes
are not supported by ext4.
On some old kernels, ext4 filesystem can not be mounted with acl and
user_xattr options by default. The following patch has enabled
these options by default:
'
ea6633369458("ext4: enable acls and user_xattr by default")'
We add acl and user_xattr support in _test_mount_opts(), and it
works normally on all kernels.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Wed, 2 Aug 2017 13:49:00 +0000 (21:49 +0800)]
common/config: unset TEST_FS_MOUNT_OPTS across config sections
TEST_FS_MOUNT_OPTS doesn't get reset before parsing next config
section, this will cause unexpected TEST_FS_MOUNT_OPTS in test,
because it can be assigned some fs-specific mount options in
_test_mount_opts, which might not be supported by the filesystem in
next config section. And MOUNT_OPTIONS is reset, I don't see why
TEST_FS_MOUNT_OPTS shouldn't be.
Also update README.config-sections to reflect this change and fix
typos (replace MOUNT_OPTIONS with TEST_FS_MOUNT_OPTS).
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Wed, 11 Jan 2017 09:38:45 +0000 (17:38 +0800)]
fstests: remove tmp files properly
Some tests and common helpers don't properly clean up tmp files and
leave them behind in /tmp dir, and these tmp files are accumulating
over time.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Thu, 3 Aug 2017 04:18:20 +0000 (12:18 +0800)]
fstests: batch update of test file mode
Some tests don't have x permission set in mode, git complains about
file mode change after running tests in fstests git repo dir. So
change all such tests to 755 mode. Performed by:
find tests ! -perm /111 -name [0-9][0-9][0-9] -exec chmod 755 {} \;
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Mon, 31 Jul 2017 04:16:33 +0000 (12:16 +0800)]
common/xfs: add iomap_dio_actor() to the dmesg filter
The warning in fs/iomap.c::iomap_dio_actor() could be triggered when
mixing dio and mmap I/O on the same sparse file. Several tests could
hit this warning now, like generic/095 generic/224 and generic/446.
So add this expected warning to whitelist too.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Mon, 31 Jul 2017 03:42:10 +0000 (11:42 +0800)]
generic/224: filter out expected XFS warnings for mixed direct/buffer I/O
generic/224 is doing concurrent direct and buffered I/O to the same
set of files, and this triggers some expected warnings on XFS. So
filter out these warnings just like what we did in generic/095 and
generic/247.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Fri, 28 Jul 2017 05:24:51 +0000 (13:24 +0800)]
new: validate groups when creating new test
Allow only lower case letters, digits, spaces and underscore when
adding groups, give prompt if there's any not-allowed characters.
Also remove redundant spaces between groups.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 21 Jul 2017 22:04:39 +0000 (15:04 -0700)]
ext4: fsmap tests
Test the GETFSMAP ioctl against ext4.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 21 Jul 2017 22:04:27 +0000 (15:04 -0700)]
xfs: only run scrub in dry run mode
When checking a filesystem, explicitly run xfs_scrub in dry run mode
so that it will not ever try to preen, fix, or optimize anything.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ernesto A. Fernández [Wed, 2 Aug 2017 04:19:34 +0000 (01:19 -0300)]
generic/449: make the test effective against xfs
Setting acls on an xfs filesystem will succeed even after running
out of space for user attributes. Use trusted attributes instead.
Also speed up the test by setting large values for the attributes.
[eguan: use perl to generate attr value, and add comments on trusted
namespace]
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>