Eryu Guan [Wed, 18 Mar 2015 03:57:33 +0000 (14:57 +1100)]
new: fix template for new case to use a single tab not four spaces
So we have preferred code style for all new test cases.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Wed, 18 Mar 2015 03:56:40 +0000 (14:56 +1100)]
generic/065: fsync file 'hello' before checking its content
Explicitly fsync the file named 'hello' before checking its content.
This way there's only one expected result for all filesystems.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Zhao Lei [Wed, 18 Mar 2015 03:55:58 +0000 (14:55 +1100)]
common: fix a typo in _require_block_device()
We need to check "$1" instead "$SCRATCH_DEV" in this function.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Wed, 18 Mar 2015 03:55:21 +0000 (14:55 +1100)]
generic: Add rudimetary RENAME_WHITEOUT test
There is no API documentation for RENAME_WHITEOUT. There is no
developer documentation for RENAME_WHITEOUT. There are not comments
in the overlayfs or ext4 implementation of RENAME_WHITEOUT.
Hence, this test simply tries to expose basic RENAME_WHITEOUT
behaviour from ext4 so we can reverse-engineer and verify
bug-for-bug renameat2(RENAME_WHITEOUT) ext4 compatibility.
Note: uses generic/078 just to keep out of the way of the 6-7 other
pending new tests.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Wed, 18 Mar 2015 03:54:44 +0000 (14:54 +1100)]
xfs/049: umount -d fails when kernel wins teardown race
When /etc/mtab is linked to /proc/mounts and we are using mount time
created loop devices (i.e. mount -o loop), the unmount can fail
with this amazingly informative error message:
umount: /mnt/scratch/test2: filesystem was unmounted, but mount(8) failed: Invalid argument
What it actually means in this case is that the kernel tore down the
loop device when the last reference went away, and it did it so fast
that mount was not able to find it in /etc/mtab after the unmount
syscall. Hence it could not find the loop device it was supposed to
tear down and has a hissy fit.
This is simple to fix: mount does not need to tear down the loop
device as the kernel does it automatically. Remove the "-d" from
the umount command, and the test passes again.
There's quite a few other tests that also use umount -d - fix them
as well.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Wed, 18 Mar 2015 03:54:30 +0000 (14:54 +1100)]
xfs: don't output mkfs sector sizes into golden output
The mkfs sector sizes are dependent on the underlying device in use,
and so is not fixed. hence it needs to be filtered from any golden
output file, otherwise tests that just differ by sector size will
fail.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Wed, 18 Mar 2015 03:54:08 +0000 (14:54 +1100)]
xfs/104: log size too small for 4k sector drives
xfs/104, xfs/119, xfs/291 and xfs/297 have small fixed log sizes. A
recent change to the kernel ramdisk changed it's physical sector
size from 512B to 4kB, and this results in mkfs calculating a log
size larger than the fixed test size and hence the tests fail.
Change the log size to a larger size that works with 4k sectors, and
also increase the size of the filesystem being created so that the
amount of data space in the filesystem does not change and hence
does not perturb the rest of the test.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Wed, 25 Feb 2015 04:38:26 +0000 (15:38 +1100)]
fstests: generic test for fsync after removing xattrs
This test is motivated by an fsync issue discovered in btrfs.
The issue was that the fsync log replay code did not remove xattrs that
were deleted before the inode was fsynced. The result was unexpected
and differed from xfs and ext3/4 for example.
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: remove deleted xattrs on fsync log replay
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Wed, 25 Feb 2015 04:37:54 +0000 (15:37 +1100)]
fstests: generic test for directory fsync after adding hard links
This test is motivated by an fsync issue discovered in btrfs.
The issue was that after adding a new hard link to an existing file
(one that was created in a past transaction) and fsync'ing the parent
directory of the new hard link, after the fsync log replay the file's
inode link count did not get its link count incremented, while the new
directory entry was visible.
Also, unlike xfs and ext4, new files under the directory we fsync were
not being written to the fsync log, nor were any child directories and
new files and links under the children directories. So this test verifies
too that btrfs has the same behaviour as xfs and ext4.
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: fix metadata inconsistencies after directory fsync
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Omar Sandoval [Wed, 25 Feb 2015 04:37:16 +0000 (15:37 +1100)]
build: add missing files to gitignore
Several binaries show up in git status after running make in a fresh
clone, and so do files introduced by normal usage.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Wed, 25 Feb 2015 04:36:52 +0000 (15:36 +1100)]
create _require_metadata_journaling, and add to tests that need it
Many tests use dm_flakey to trigger log replay, but for filesystems that
don't support metadata journaling, this causes failures when it shouldn't.
(i.e. we can hardly test log replay if there is no log, and the subsequent
filesystem check will turn up errors).
For some tests they actually sync everything we care about, and find
inconsistencies elsewhere, but I erred on the side of simply not running
the test in most cases.
Tested-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Wed, 25 Feb 2015 04:35:56 +0000 (15:35 +1100)]
btrfs/049: btrfs test, not generic
It's not much fun to run btrfs-specific tests on non-btrfs
filesystems. ;)
> EXT4-fs (dm-12): Unrecognized mount option "inode_cache" or missing value
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Wed, 25 Feb 2015 04:35:20 +0000 (15:35 +1100)]
generic/325: Fix test case to work on 64K page size.
The test case passes 32K as the offset value to msync. This fails on machines
with 64K page size. Fix this by creating a larger file and passing offset
values which are multiples of 64K.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:35:08 +0000 (15:35 +1100)]
fsx: Add fallocate insert range operation
This commit adds fallocate FALLOC_FL_INSERT_RANGE support for fsx.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:34:48 +0000 (15:34 +1100)]
fsstress: Add fallocate insert range operation
This commit adds insert operation support for fsstress, which is
meant to exercise fallocate FALLOC_FL_INSERT_RANGE support.
[dchinner: turn off this op for xfs/068, which expects an exact
outcome from the fsstress execution. ]
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:34:21 +0000 (15:34 +1100)]
generic: Test multiple fallocate insert/collapse range calls
This testcase tests finsert range a single alternate block
multiple times and test merge code of collase range.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:33:55 +0000 (15:33 +1100)]
generic: Delayed allocation multi insert
This testcase tests various corner cases with delayed extents and
pre-existing holes for finsert range functionality over different
types of extents.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:33:19 +0000 (15:33 +1100)]
generic: Multi insert range tests
This testcase tests various corner cases with pre-existing holes
for finsert range functionality over different type of extents.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:33:06 +0000 (15:33 +1100)]
generic: Delayed allocation insert range
This testcase tests various corner cases with delayed extents
for finsert range functionality over different type of extents.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Namjae Jeon [Wed, 25 Feb 2015 04:32:47 +0000 (15:32 +1100)]
generic: Simple insert range tests
This testcase tests various corner cases for finsert range
functionality over different type of extents.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 16 Feb 2015 00:36:12 +0000 (11:36 +1100)]
generic: test for fsync after punching hole
This test is motivated by an fsync issue discovered in btrfs.
The issue was that after punching a hole for a small range, which
affected only a partial page, an fsync operation would have no effect
at all. This was because for this particular case the btrfs hole
punching implementation did not update some btrfs specific inode
metadata that is required to determine if an fsync operation needs
to update the fsync log. For this to happen, it was also necessary
that in the transaction where the hole punching was performed, and
before the fsync operation, no other operation that modified the file
(or its metadata) was performed.
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: add missing inode update when punching hole
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 [Sun, 15 Feb 2015 23:14:15 +0000 (10:14 +1100)]
generic: Another fsync after adding hard link test
This test is motivated by an fsync issue discovered in btrfs.
The issue was that we could lose file data, that was previously
fsync'ed successfully, if we end up adding a hard link to our
inode and then persist the fsync log later via an fsync of other
inode for example. This is similar to my previous test, except
that in this test the inode that ends up losing data was created
(with some data) in a transaction different from the one we made
an fsync.
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: fix fsync data loss after adding hard link to inode
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 [Sun, 15 Feb 2015 23:13:27 +0000 (10:13 +1100)]
generic: add test for fsync after creating hard link
This test is motivated by an fsync issue discovered in btrfs.
The issue was that we could lose file data, that was previously
fsync'ed successfully, if we end up adding a hard link to our
inode and then persist the fsync log later via an fsync of other
inode for example.
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: fix fsync data loss after adding hard link to inode
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jaegeuk Kim [Thu, 12 Feb 2015 03:22:59 +0000 (14:22 +1100)]
generic: relocate log recovery tests into tests/generic/
This patch moves the generic testcases defined in xfs into tests/generic/.
xfs/085 -> generic/052
xfs/086 -> generic/054
xfs/087 -> generic/055
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 [Thu, 12 Feb 2015 03:22:33 +0000 (14:22 +1100)]
xfs/087: give quota mount option per filesystem
This patch add _get_quota_option to assign the mount option selectively.
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 [Thu, 12 Feb 2015 03:22:11 +0000 (14:22 +1100)]
common/log: add _get_log_configs for testing options
This patch adds _get_log_configs for xfs and f2fs to test several
mount options for:
xfs/086
* xfs/087
In xfs/087, one more test was added, so 10 tests will be done in
total.
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 [Thu, 12 Feb 2015 03:21:21 +0000 (14:21 +1100)]
xfs/086,087: remove specific testing options in output
This patch removes the mkfs and mount options specified in output
files in xfs/086 and xfs/087.
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 [Thu, 12 Feb 2015 03:20:58 +0000 (14:20 +1100)]
common: define _require_logstate
This patch defines logstate by adding dump.f2fs for f2fs's clean and
dirty logs. This macro is added into:
xfs/085
xfs/086
xfs/087
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 [Thu, 12 Feb 2015 03:20:27 +0000 (14:20 +1100)]
generic: relocate xfs shutdown tests into tests/generic/
This patch moves the generic testcases defined in xfs into
tests/generic/.
xfs/053 -> generic/042
xfs/137 -> generic/043
xfs/138 -> generic/044
xfs/139 -> generic/045
xfs/140 -> generic/046
xfs/179 -> generic/047
xfs/180 -> generic/048
xfs/182 -> generic/049
xfs/200 -> generic/050
xfs/306 -> generic/051
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 [Thu, 12 Feb 2015 03:19:37 +0000 (14:19 +1100)]
common: add _require_norecovery
This patch adds checking code whether filesystem supports norecovery
mount option or not. Use this in the following xfs test.
xfs/200 (recovery vs ro-block device)
Currently, norecovery mount option is used by xfs only. But some of
log-based filesystems (e.g., f2fs) are able to support it later.
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 [Thu, 12 Feb 2015 03:18:23 +0000 (14:18 +1100)]
common: use fiemap to count extents and holes
For the follwoing tests, this patch adds general script to get extent and
hole counts.
xfs/137 (data vs filesize)
xfs/138 (data vs filesize vs truncate)
xfs/139 (data vs filesize vs partial truncate)
xfs/140 (data vs filesize vs extending truncate)
xfs/179 (data vs filesize w/ fsync)
xfs/180 (data vs filesize w/ sync)
xfs/182 (data vs filesize w/ recovery)
It also requires these tests to check for fiemap support.
[dchinner: use _require_xfs_io_command "fiemap" for consistency]
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 [Thu, 12 Feb 2015 03:14:52 +0000 (14:14 +1100)]
common: add _require_scratch_shtudown
This is to detect whether filesystem supports shutdown feature or not.
And let use this into the following xfs tests.
xfs/053 (data exposure)
xfs/137 (data vs filesize)
xfs/138 (data vs filesize vs truncate)
xfs/139 (data vs filesize vs partial truncate)
xfs/140 (data vs filesize vs extending truncate)
xfs/179 (data vs filesize w/ fsync)
xfs/180 (data vs filesize w/ sync)
xfs/182 (data vs filesize w/ recovery)
xfs/200 (recovery vs ro-block device)
xfs/306 (fsstress vs recovery)
xfs/085
xfs/086
xfs/087
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Anna Schumaker [Thu, 12 Feb 2015 03:14:20 +0000 (14:14 +1100)]
fsx: check for filesystem support of FALLOCATE_FL_KEEP_SIZE
The NFS implementation of fallocate() does not support passing the
KEEP_SIZE flag by itself, causing tests to randomly fail.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xing Gu [Thu, 12 Feb 2015 03:14:00 +0000 (14:14 +1100)]
btrfs: add regression test for remount with thread_pool resized
Regression test for a btrfs issue of resizing 'thread_pool' when
remount the fs.
This regression was introduced by the following linux kernel commit:
btrfs: Added btrfs_workqueue_struct implemented ordered
execution based on kernel workqueue
08a9ff3264181986d1d692a4e6fce3669700c9f8
And it was fixed by the following linux kernel commit:
btrfs: fix crash in remount(thread_pool=) case
800ee2247f483b6d05ed47ef3bbc90b56451746c
Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiaoguang Wang [Thu, 12 Feb 2015 03:13:44 +0000 (14:13 +1100)]
ext4/304: ignore EINVAL and ENODATA error
ext4/304 is also ext4 defragmentation stress test, which creates several
threads to perform defragmentation using 'inplace' mode, but there is a
possible race that the donor file has been truncated by thread_A, while
thread_B starts to call ioctl(EXT4_IOC_MOVE_EXT), then we may get a
EINVAL or ENODATA error.
Please see: http://www.spinics.net/lists/linux-ext4/msg46900.html for
detailed information.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
David Sterba [Thu, 12 Feb 2015 03:13:15 +0000 (14:13 +1100)]
common: helper to print raw byte output from qgroup show
Newer versions of btrfs-progs change the default output of 'qgroup
show', we have to check what version is running and use the right option
if needed.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Brian Foster [Thu, 12 Feb 2015 03:12:14 +0000 (14:12 +1100)]
xfs: xfs_repair secondary sb verification regression test
The secondary superblock verification in xfs_repair was subject to a bug
that unnecessarily leads to a brute force superblock scan if the last
superblock in the fs happens to be corrupt. Normally, xfs_repair handles
one-off superblock corruption gracefully using a heuristic that finds
the most consistent superblock content across the set of secondary
superblocks.
Create a regression test for xfs_repair that corrupts the last
superblock in the fs. Verify the superblock is updated from the
previously verified sb content and a brute force scan is not initiated.
In the event of failure, detect that a brute force scan has started and
abort the repair in order to fail the test quickly.
To support the test, extend the xfs_repair filter to handle corrupted
superblock repair output and provide generic test output for arbitrary
AG counts.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Thu, 12 Feb 2015 03:11:04 +0000 (14:11 +1100)]
shared/032: handle mkfs.* in either /sbin or /usr/sbin
mkfs executables may live in either /sbin or /usr/sbin, and
the current regexp in this test only catches the former,
and so the test won't run properly with the latter.
Fix this by filtering out whatever was found as
${MKFS_PROG}, rather than a hard-coded /sbin/mkfs path.
Because the list was generated by using a wildcard
with ${MKFS_PROG}.* this will always be the correct filter.
Reported-by: Boaz Harrosh <boaz@plexistor.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Iustin Pop [Wed, 11 Feb 2015 05:54:16 +0000 (16:54 +1100)]
xfs: add test for XFS_IOC_FSSETXATTR behaviour
Adds a new test that checks for correct behaviour of
XFS_IOC_FSSETXATTR for directories: extent sizes should always be
settable on a directory, even if the directory already has allocated
extents.
Signed-off-by: Iustin Pop <iustin@k1024.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiaoguang Wang [Wed, 21 Jan 2015 05:19:33 +0000 (16:19 +1100)]
ext4/30[23]: ignore EBUSY error
xfstests ext4/302, ext4/303 are ext4 defragmentation stress test,
which will ioctl(EXT4_IOC_MOVE_EXT), so EBUSY is expected to happen,
for example, when page's corresponding buffer_head's state is BH_Dirty.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Acked-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Wed, 21 Jan 2015 05:19:33 +0000 (16:19 +1100)]
common: add _disable_dmesg_check function
Introduce _disable_dmesg_check function, which can be called by tests
that generate WARNINGs etc. on purpose, so the tests won't fail
_dmesg_check.
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 [Wed, 21 Jan 2015 05:19:33 +0000 (16:19 +1100)]
check: check dmesg log after each test
Check kernel BUG, WARNING etc. in dmesg log after each test and fail the
test if something is found. dmesg log can be found at result dir.
This check now depends on the logging of running tests in dmesg, so this
check can be done without clearing dmesg buffer nor dumping all dmesg to
a file, which can potentially eat all free space on testing host.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Wed, 21 Jan 2015 05:19:33 +0000 (16:19 +1100)]
check: log running test to dmesg
We already log the running test to system logs via "logger"
but viro pointed out that we can use /dev/kmsg to insert it
into dmesg as well. When looking at the serial console that
could be pretty useful.
Thanks to viro for the test -w suggestion too.
[Eryu Guan adds timestamp to dmesg too]
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Wed, 21 Jan 2015 05:19:21 +0000 (16:19 +1100)]
btrfs/017: support all possible page sizes
Currently this test fails on 2 situations:
1) The scratch device supports trim/discard. In this case any modern
version of mkfs.btrfs outputs a message (to stderr) informing that
a trim is performed, which the golden output doesn't expect:
btrfs/017 - output mismatch (see /git/xfstests/results//btrfs/017.out.bad)
--- tests/btrfs/017.out 2015-01-06 11:14:22.
730143144 +0000
+++ /git/xfstests/results//btrfs/017.out.bad 2015-01-14 22:33:01.
582195719 +0000
@@ -1,4 +1,5 @@
QA output created by 017
+Performing full device TRIM (100.00GiB) ...
wrote 8192/8192 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
4096 4096
...
(Run 'diff -u tests/btrfs/017.out /git/xfstests/results//btrfs/017.out.bad' to see the entire diff)
So like others tests do, just redirect mkfs' standard error.
2) On platforms with a page size greater than 4Kb. At the moment btrfs
doesn't support a node/leaf size smaller than the page size, but it
supports a larger one. So use the max supported node size (64Kb) so
that the test runs on any platform currently supported by Linux.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Wed, 21 Jan 2015 05:01:25 +0000 (16:01 +1100)]
generic: test fsync on inode with many hard links differently
This test is motivated by an fsync issue discovered in btrfs.
The steps to trigger the issue were:
1) remove an hard link from an inode with a large number of hard links;
2) add a new hard link;
3) add another hard link with the same name as the one removed in step 1;
4) fsync the inode.
These steps made the btrfs fsync log replay fail (with the -EOVERFLOW
error), making the filesystem unmountable, requiring the use of
btrfs-zero-log (it wipes the fsync log) in order to make the filesystem
mountable again (but losing some data/metadata).
The btrfs issue was fixed by the following linux kernel patches:
Btrfs: fix fsync when extend references are added to an inode
Btrfs: fix fsync log replay for inodes with a mix of regular refs and extrefs
This issue was present in btrfs since the extrefs (extend references)
feature was added (2012).
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 [Wed, 21 Jan 2015 05:00:01 +0000 (16:00 +1100)]
generic: test fsync on inode with many hard links
This test is motivated by an fsync issue discovered in btrfs.
The issue in btrfs was that adding a new hard link to an inode that
already had a large number of hardlinks and fsync the inode, would
make the fsync log replay code update the inode with a wrong link count
(smaller than the correct value). This resulted later in dangling
directory index entries, after removing most of the hard links
(correct_value - wrong_value), that were visible to user space but it
was impossible to delete them or do any other operation on them (since
they pointed to an inode that didn't exist anymore, resulting in -ESTALE
errors).
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: fix fsync when extend references are added to an inode
This issue was present in btrfs since the extrefs (extend references)
feature was added (2012).
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 [Wed, 21 Jan 2015 04:58:23 +0000 (15:58 +1100)]
generic: test fsync after unlink
This test is motivated by an fsync issue discovered in btrfs.
The issue was that after fsyncing an inode that got its link count
decremented, and the new link count is greater than zero, after the
fsync log replay the inode's parent directory metadata became
inconsistent - it had a wrong i_size and dangling index entries which
prevented the directory from ever being removed (rmdir always failed
with -ENOTEMPTY, even if the directory had no more child inodes).
The btrfs issue was fixed by the following linux kernel patch:
Btrfs: fix directory inconsistency after fsync log replay
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 [Wed, 21 Jan 2015 04:57:03 +0000 (15:57 +1100)]
common: fix function _require_batched_discard()
Commit
01d42b7efe3fcb9169befda3072c41d25a87c920 broke the check
for the success status of running fstrim. The [ ] bracets should
have been killed. This made several tests being skipped even when
the test/scratch devices support trim/discard.
For reference:
$ [ fstrim /mnt/ ] || echo foobar
bash: [: fstrim: unary operator expected
foobar
$ fstrim /mnt/ || echo foobar
$ echo $?
0
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jaegeuk Kim [Wed, 24 Dec 2014 03:56:26 +0000 (14:56 +1100)]
xfstests: f2fs support
This patch adds to support f2fs file system.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xing Gu [Wed, 24 Dec 2014 03:56:17 +0000 (14:56 +1100)]
xfs/111: fix cp of missing file
After installing the test suite, src directory only contains binary
programs in the final building directory. Here executing "cp src/itrash.c
$SCRATCH_MNT/${I}" will output "cp: cannot stat 'src/itrash.c': No
such file or directory" error message. Fix it.
Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dushan Tcholich [Wed, 24 Dec 2014 03:56:07 +0000 (14:56 +1100)]
Reiser4 initial implementation
Initial xfstests implementation for Reiser4 filesystem.
Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Theodore Ts'o [Wed, 24 Dec 2014 03:53:10 +0000 (14:53 +1100)]
ext4/004: limit the amount of data written so test runs faster
Previously this test was taking 6-7 minutes, and writing half a
gigabyte of data in the dump/restore test directory. Change this to
be about 60 megs, and to take ~20 seconds.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Wed, 24 Dec 2014 03:51:50 +0000 (14:51 +1100)]
check: treat _check_{test,scratch}_fs failures as test failures
Currently if _check_test_fs and/or _check_scratch_fs find corruption,
the test itself is still reported as pass, like
[root@hp-dl388eg8-01 xfstests]# ./check xfs/071 xfs/072
FSTYP -- xfs (non-debug)
PLATFORM -- Linux/x86_64 hp-dl388eg8-01 3.18.0-rc7+
MKFS_OPTIONS -- -f -bsize=4096 /dev/sda6
MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/sda6 /mnt/testarea/scratch
xfs/071 2s
_check_xfs_filesystem: filesystem on /dev/sda6 is inconsistent (r) (see /root/xfstests/results//xfs/071.full)
xfs/072 1s
Ran: xfs/071 xfs/072
Passed all 2 tests
[root@hp-dl388eg8-01 xfstests]# echo $?
0
Usually it's not a problem, but it does confuse scripts that depend on
return value of check. Update check to treat _check_{test,scratch}_fs
failures as test failures too, new test output is like
[root@hp-dl388eg8-01 xfstests]# ./check xfs/071 xfs/072
FSTYP -- xfs (non-debug)
PLATFORM -- Linux/x86_64 hp-dl388eg8-01 3.18.0-rc7+
MKFS_OPTIONS -- -f -bsize=4096 /dev/sda6
MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/sda6 /mnt/testarea/scratch
xfs/071 2s ... 2s
_check_xfs_filesystem: filesystem on /dev/sda6 is inconsistent (r) (see /root/xfstests/results//xfs/071.full)
xfs/072 1s ... 1s
Ran: xfs/071 xfs/072
Failures: xfs/071
Failed 1 of 2 tests
[root@hp-dl388eg8-01 xfstests]# echo $?
1
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 [Wed, 24 Dec 2014 03:51:25 +0000 (14:51 +1100)]
common: return failure if _check_xxx_filesystem find corruption
So the callers could know if these functions find corruptions by the
return value.
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 [Wed, 24 Dec 2014 03:51:04 +0000 (14:51 +1100)]
common: exit only if tests find corruption
If _check_xxx_filesystem called by tests when corruption found
they exit, but we don't want the calls from the test harness itself to
exit when corruption is found.
_check_xfs_filesystem already behaves correctly, make
_check_generic_filesystem and _check_btrfs_filesystem follow the same
behavior.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Liu Bo [Wed, 24 Dec 2014 03:48:23 +0000 (14:48 +1100)]
btrfs: add test case for qgroup account on shared extents
This is a regression test of
'commit
fcebe4562dec ("Btrfs: rework qgroup accounting")',
it's used to verify that removing shared extents can end up incorrect
qgroup accounting.
It can produce qgroup related warnings.
The fix is https://patchwork.kernel.org/patch/
5499981/
"Btrfs: fix a warning of qgroup account on shared extents"
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Tested-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Junho Ryu [Tue, 16 Dec 2014 03:01:06 +0000 (14:01 +1100)]
Check O_DIRECT support before testing direct I/O
Some filesystems do not support O_DIRECT. Check whether TEST_DIR supports
it by running xfs_io with -d flag.
Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dushan Tcholich [Mon, 15 Dec 2014 23:53:57 +0000 (10:53 +1100)]
generic/038: require fallocate support
Add test for fallocate(2) support
Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dushan Tcholich [Mon, 15 Dec 2014 23:53:57 +0000 (10:53 +1100)]
common: unify _require_batched_discard
To check for FITRIM tests used _require_fstrim() and
_test_batched_discard() but as _test_batched_discard() already
includes _test_fstrim() unify FSTRIM check throughout xfstests with
_require_batched_discard().
Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Theodore Ts'o [Mon, 15 Dec 2014 23:53:57 +0000 (10:53 +1100)]
ext4/308: require fallocate support
These tests use the falloc command in xfs_io, and there are some file
systems (ext3) or file system configurations (ext4 in ext3
compatibility mode) which do not support fallocate. So add the
explicit requirement to avoid false test failures.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 15 Dec 2014 23:53:42 +0000 (10:53 +1100)]
btrfs: add regression test for clone ioctl
Regression test for a btrfs clone ioctl issue where races between
a clone operation and concurrent target file reads would result in
leaving stale data in the page cache. After the clone operation
finished, reading from the clone target file would return the old
and no longer valid data. This affected only buffered reads (i.e.
didn't affect direct IO reads).
This issue was fixed by the following linux kernel patch:
Btrfs: ensure readers see new data after a clone operation
(commit
c125b8bff1d9f6c8c91ce4eb8bd5616058c7d510)
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 15 Dec 2014 23:50:56 +0000 (10:50 +1100)]
fstests: btrfs, add test for snapshoting after file write + truncate
Regression test for a btrfs issue where if right after the snapshot
creation ioctl started, a file write followed by a file truncate
happened, with both operations increasing the file's size, the created
snapshot would capture an inconsistent state of the file system tree.
That state reflected the file truncation but it didn't reflect the
write operation, and left a gap between two file extent items (and
that gap corresponded to the total or a partial area of the write
operation's range).
This issue was fixed by the following linux kernel patch:
Btrfs: fix snapshot inconsistency after a file write followed by truncate
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Theodore Ts'o [Mon, 15 Dec 2014 23:50:21 +0000 (10:50 +1100)]
common: use mke2fs -F instead of piping in yes
It's possible based on a race conditions (and possibly the version of
coreutils which supplies /usr/bin/yes) that commands of the form:
yes | $MKFS_PROG ...
will end up causing the following failure:
shared/298 16s ... [23:49:03] [23:49:19] - output mismatch (see /results/results-4k/shared/298.out.bad)
--- tests/shared/298.out 2014-10-31 10:13:04.
000000000 -0400
+++ /results/results-4k/shared/298.out.bad 2014-11-29 23:49:19.
118138099 -0500
@@ -1,4 +1,6 @@
QA output created by 298
+yes: standard output: Broken pipe
+yes: write error
Generating garbage on loop...done.
Running fstrim...done.
Detecting interesting holes in image...done.
...
(Run 'diff -u tests/shared/298.out /results/results-4k/shared/298.out.bad' to see the entire diff)
Using mke2fs's -F option instad of "yes | $MKFS_PROG" fixes this issue.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 15 Dec 2014 23:49:57 +0000 (10:49 +1100)]
generic/299: make sure fio really exits
Fix two problems in generic/299
1. Remove $seqres.full before test, otherwise the file is growing all
the time.
2. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
David Disseldorp [Mon, 15 Dec 2014 23:48:51 +0000 (10:48 +1100)]
cifs: add missing Makefile
This fixes the make install target, which traverses all tests/*
subdirectories.
Reported-by: David Drysdale <drysdale@google.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 15 Dec 2014 23:48:35 +0000 (10:48 +1100)]
btrfs: add groups for btrfs tests
Some new btrfs groups have been added in the btrfs stress patchset, add
other tests to proper groups too.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Vishal Verma [Fri, 12 Dec 2014 00:26:56 +0000 (11:26 +1100)]
ext4: the _require checks for bigalloc need a larger fs size
_require_ext4_bigalloc and _require_ext4_mkfs_bigalloc create a
200k fs. DAX (as XIP before it) relies on a fs block size ==
system page size; ie 4k for us. With a 200k fs size limit,
mkfs refuses to create a filesystem with a 4k block size, so
the check fails, but for a bogus reason.
Increasing the fs size to 512m allows mkfs to create a filesystem
with 4k block size, so the test passes.
Signed-off-by: Vishal Verma <vishal.l.verma@linux.intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Fri, 12 Dec 2014 00:26:45 +0000 (11:26 +1100)]
common: fix comment about _require_test
_require_test will mount test dev if not mounted, fix the comment to
reflect that.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Fri, 12 Dec 2014 00:26:31 +0000 (11:26 +1100)]
btrfs/017: remove duplicate test
btrfs/017 is same as btrfs/015, remove it.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Fri, 12 Dec 2014 00:26:15 +0000 (11:26 +1100)]
fstests: change mode of test files to 0755
Performed by
find tests -perm 644 -name [0-9][0-9][0-9] -exec chmod 755 {} \;
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Fri, 12 Dec 2014 00:25:47 +0000 (11:25 +1100)]
xfs/071: remove xfs/071.out from git
xfs/071.out is supposed to linked to the right out file at run time.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
David Disseldorp [Fri, 12 Dec 2014 00:24:10 +0000 (11:24 +1100)]
cifs: add server-side copy sanity test
This test uses the cloner binary to issue CIFS_IOC_COPYCHUNK_FILE
server-side copy requests.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Acked-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
David Disseldorp [Fri, 12 Dec 2014 00:23:06 +0000 (11:23 +1100)]
common: rename _require_btrfs_cloner to _require_cloner
src/cloner.c is no longer Btrfs specific, so use a generic name.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Acked-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Fri, 12 Dec 2014 00:07:22 +0000 (11:07 +1100)]
btrfs: add test to stress chunk allocation/removal and fstrim
Stress btrfs' block group allocation and deallocation while running
fstrim in parallel. Part of the goal is also to get data block groups
deallocated so that new metadata block groups, using the same physical
device space ranges, get allocated while fstrim is running. This caused
several issues ranging from invalid memory accesses, kernel crashes,
metadata or data corruption, free space cache inconsistencies, free
space leaks and memory leaks.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiaoguang Wang [Thu, 11 Dec 2014 23:56:26 +0000 (10:56 +1100)]
ext4: add dump/restore test
This test case will first use fsstress to fill a file system, then
dump it to standard output and restore it from standard input, finally
check that the original contents and the new contents generated by
restore tool will be same.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Steve French [Thu, 11 Dec 2014 23:55:29 +0000 (10:55 +1100)]
common: update README to list build dependencies
Add sample list of packages (dependencies) required to build XFSTESTS
and add a step to the instructions to mention creating the test
user needed for some of the ACL tests.
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Thu, 11 Dec 2014 23:55:24 +0000 (10:55 +1100)]
generic: use xfs_io falloc, not fallocate
generic/315 fails messily if the fallocate command isn't present.
generic/299 also uses "fallocate" and "truncate" binaries which may
not be present.
Switch both to use xfs_io, and we already have the _require for
that, because it's what every other test uses...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Thu, 11 Dec 2014 23:55:15 +0000 (10:55 +1100)]
xfs/096: strip log stripe warnings from mkfs.xfs
The warnings have been removed when stripe unit/width are too big
for the log stripe unit to be set. Hence add them to the mkfs.xfs
filter and strip them from golden output file so the test succeeds
on both new and old mfks binaries.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Thu, 11 Dec 2014 23:55:15 +0000 (10:55 +1100)]
xfs: test xfs_copy for various sector and block sizes
This tests xfs_copy, copying all combinations of sector
size and block size possible on the platform running the
test.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Thu, 11 Dec 2014 23:53:55 +0000 (10:53 +1100)]
common: enable tests that require scratch device on CIFS
Just like commit
76c5f3c common: re-enable tests that require scratch dev on NFS
Enable tests that require scratch device on CIFS too to get a better
test coverage.
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, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
generic: add test to verify xattr replace operations are atomic
This test verifies that replacing a xattr's value is an atomic
operation. This is motivated by an issue in btrfs where replacing
a xattr's value wasn't an atomic operation, it consisted of
removing the old value and then inserting the new value in a
btree. This made readers (getxattr and listxattrs) not getting
neither the old nor the new value during a short time window.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Brian Foster [Mon, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
xfs/062: verify bulkstat finds all inodes
The bulkstat mechanism is used by xfsdump and other tools to index all
inodes allocated in a filesystem. Run some simple tests with varying
inode layouts and bulkstat batch sizes to verify bulkstat finds the
expected number of inodes.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
generic/277: add _require_attrs
NFS doesn't support attr yet, add _require_attrs in generic/277 to
avoid failure when testing on NFS.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
common: use _scratch_mount helper in _require_relatime()
Change the way how _require_relatime() mount $SCRATCH_DEV, use
_scratch_mount helper so $SCRATCH_DEV is mounted with selinux context,
to avoid "same superblock, different selinux context" failure.
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, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
generic: skip atime related tests on NFS
From nfs(5) we can know that atime related mount options have no
effect on NFS mounts, so add _require_atime() helper to skip atime
tests on NFS
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, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
common: add _require_block_device() helper
Add _require_block_device() helper and use it in _require_dm_flakey()
and generic/076.
_require_dm_flakey() assumes $SCRATCH_DEV is a block device, now it can
also be a NFS export.
generic/076 does "cat $SCRATCH_DEV" which will fail when testing on NFS.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
common: re-enable tests that require scratch dev on NFS
Commit
c041421 ("xfstests: stop special casing nfs and udf")
disables tests requires scratch dev running on NFS. Add the
infrastructure needed to re-enable them to get a larger test
coverage on NFS.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Anna Schumaker [Mon, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
common: Fixes for testing NFS over IPv6
When testing NFS over IPv6, the user may set a $TEST_DEV of the form
[fe80::42]:/export. The use of square brackets surrounding the IPv6
address is an accepted convention, but grep and awk think that our IPv6
address is actually a regex and tries to evaluate it instead. The
result is that xfstests reports our filesystem "is busy or already
mounted".
This patch fixes the IPv6 problem by telling awk and grep to treat
$TEST_DEV as a fixed string rather than a regex.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Mon, 10 Nov 2014 07:06:23 +0000 (18:06 +1100)]
xfs/068: fix expected output file for proper restore output
Oh my, I did a very bad thing - I wrote a new test to
check for xfsdump regressions, but did not create the
.out file with a known-good kernel.
This matches output from older, stable kernels, and is the
proper expected output. Sorry about that!
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dmitry Monakhov [Mon, 10 Nov 2014 07:06:19 +0000 (18:06 +1100)]
aio: add regression test race between write and fcntl
perform AIO-DIO and fcntl(F_SETFL) concurently. Unaligned AIO likely
results in synchronization which makes the race window wider.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Dmitry Monakhov [Mon, 10 Nov 2014 07:01:10 +0000 (18:01 +1100)]
fstests: update 'new' script
- Update script to support new test cheme tests/$fs_type/$TEST_IDX
- Try to use first unused ID
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Liu Bo [Mon, 10 Nov 2014 07:01:07 +0000 (18:01 +1100)]
aio: fix memory corruption in aio-last-ref-held-by-io
This's been detected by testing generic/323 on btrfs, it keeps
producing chaos of checksum errors.
It is because aio-last-ref-held-by-io uses a static buffer that is
been used repeatedly for every io_submit() call, but we'll issue
NUM_IOS(=16) io_sumbit() in a 'for' loop at a time, and when those
data read by aio has not finish its endio(), its memory is likely to
be used in the next io_submit, which ends up data corruption and
numerous checksum errors.
This allocates memory for each io_submit() and generic/323 runs fine
after this.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 10 Nov 2014 02:05:22 +0000 (13:05 +1100)]
xfs/195: Use XFSDUMP_PROG instead of xfsdump directly
Use appropriate environment variable (XFSDUMP_PROG) instead of
hardcoding 'xfsdump' name. Also make the test fail graciously when
xfsdump isn't installed.
We also make XFSDUMP_PROG be equal to empty string instead of -e when
xfsdump isn't installed. The changes require some tweaking to output
filtering since full command path now appears in the output.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Qu Wenruo [Mon, 10 Nov 2014 02:04:00 +0000 (13:04 +1100)]
btrfs: regression test for btrfs extent merge
The following kernel commit introduced the bug:
51f395ad btrfs: Use right extent length when inserting overlap extent map.
When btrfs commit race with btrfs_get_extent(), merge_extent_mapping()
may build up a new extent which length overflows and cause extent map
insert fail, causing the caller get a -EEXIST error.
This regression is fixed by the following patches:
btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map
btrfs: Fix the wrong condition judgment about subset extent map
Cc: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 10 Nov 2014 02:03:43 +0000 (13:03 +1100)]
btrfs: regression test for ro snapshot creation
Regression test for a btrfs issue where creation of readonly snapshots caused
the filesystem to get into an inconsistent state.
This regression was introduced in the 3.17 kernel and fixed by reverting the
following linux kernel commit:
Btrfs: race free update of commit root for ro snapshots
9c3b306e1c9e6be4be09e99a8fe2227d1005effc
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Eric Sandeen [Tue, 14 Oct 2014 11:59:39 +0000 (22:59 +1100)]
xfs: test larger dump/restore to/from file
This test creates a large-ish directory structure using
fsstress, and does a dump/restore to make sure we dump
all the files.
Without the fix for the regression caused by:
c7cb51d xfs: fix error handling at xfs_inumbers
we will see failures like:
-xfsrestore: 486 directories and 1590 entries processed
+xfsrestore: 30 directories and 227 entries processed
as it fails to process all inodes.
I think that existing tests have a much smaller set of files,
and so don't trip the bug.
I don't do a file-by-file comparison here, because for some
reason the diff output gets garbled; this test only checks
that we've dumped & restored the correct number of files.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Brian Foster [Tue, 14 Oct 2014 11:59:39 +0000 (22:59 +1100)]
xfs/053: test for stale data exposure via falloc/writeback interaction
XFS buffered I/O writeback has a subtle race condition that leads to
stale data exposure if the filesystem happens to crash after delayed
allocation blocks are converted on disk and before data is written back
to said blocks.
Use file allocation commands to attempt to reproduce a related, but
slightly different variant of this problem. The associated falloc
commands can lead to partial writeback that converts an extent larger
than the range affected by falloc. If the filesystem crashes after the
extent conversion but before all other cached data is written to the
extent, stale data can be exposed.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Tue, 14 Oct 2014 11:59:39 +0000 (22:59 +1100)]
btrfs: regression test for btrfs incremental send
This is a regression test for a btrfs incremental send issue.
If between two snapshots we rename an existing directory named X to Y and
make it a child (direct or not) of a new inode named X, we were delaying
the move/rename of the former directory unnecessarily, which would result
in attempting to rename the new directory from its orphan name to name X
prematurely. This made btrfs receive fail with an error message like the
following:
rename o261-7-0 -> merlin/RC/OSD failed
This issue was a regression in the 3.16 kernel and got fixed by the
following linux kernel btrfs patch:
Btrfs: send, don't delay dir move if there's a new parent inode
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Wang Shilong [Tue, 14 Oct 2014 11:59:39 +0000 (22:59 +1100)]
shared/032: fix fsck failure
while running ./check tests/shared/032, it outputs something like:
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 vm01 3.17.0-rc5+
MKFS_OPTIONS -- /dev/sdc
MOUNT_OPTIONS -- /dev/sdc /mnt/scratch
shared/032 2s ... 2s
_check_btrfs_filesystem: filesystem on /dev/sdc is inconsistent (see /root/xfstests-dev/results//shared/032.full)
Ran: shared/032
Passed all 1 tests
This is because xfstests will run fsck after each unit test,
for tests/shared/032, we have reformated SCRATCH_DEV to other fs,
fix this problem by skipping fsck here.
Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Anna Schumaker [Tue, 14 Oct 2014 11:59:38 +0000 (22:59 +1100)]
common: Re-enable testing over NFS
83ef157 (common: Check fs consistency on TEST_DEV only when needed) has
_require_test unconditionally return _notrun when testing on an NFS
filesystem, essentially disabling NFS. This patch changes the code to
validate $TEST_DEV and only call _notrun if validation fails.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>