Theodore Ts'o [Wed, 29 Jun 2016 01:32:55 +0000 (21:32 -0400)]
common/rc: ext4 doesn't support O_DIRECT with encryption
Teach _require_odirect to skip the O_DIRECT tests if the ext4 mount
option "test_dummy_encryption" is enabled, since O_DIRECT doesen't
make sense when file system level encryption is enabled, and several
tests which use O_DIRECT --- ext4/301, ext4/304, generic/250 and
generic/252 --- fail when encryption is enabled.
Eryu Guan [Thu, 23 Jun 2016 06:09:47 +0000 (14:09 +0800)]
ext4/271: _notrun if there are journal related mount options
ext4/271 runs in no journal mode (-onoload), so running test with
journal related mount options makes no sense, and test fails after
kernel commit 1e381f60dad9 ("ext4: do not allow journal_opts for fs
w/o journal"), journal related mount options are not allowed in no
journal mode. So _notrun if there're journal related mount options.
Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Some tests require that there's no certain mount option in
MKFS_OPTIONS, so introduce a new helper
_exclude_scratch_mount_option() to do the check on $MOUNT_OPTIONS.
Also convert generic/192 and xfs/134 to use this helper.
Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
btrfs fi sync /mnt, now does not output anything for success,
so the 006.out should be updated.
This change in btrfs-progs was introduced in the commit b005ca024990569d2de459485682158633937928
btrfs-progs: fi sync: make it silent by default
which was integrated at btrfs-progs version v4.5.2
Eryu Guan [Fri, 17 Jun 2016 10:54:28 +0000 (18:54 +0800)]
dmthin: express low_water in cluster_size not sector size
I noticed that thin-pool sent out "reached low water mark for data
device" event even before thin-pool device was mounted in
generic/347, this is because low water mark was set to a too high
value.
According to kernel thin-provisioning.txt documentation, low water
mark should be expressed in blocks of $cluster_size, not in sectors.
"$low_water_mark is expressed in blocks of size $data_block_size."
Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Tue, 21 Jun 2016 10:56:37 +0000 (18:56 +0800)]
xfs/186: run test on expected XFS configuration
Usually xfs/186 _notrun on crc enabled XFS because of
_require_attr_v1, since v2 attr format is always enabled on v5 XFS.
But when testing on 512B block size XFS, i.e. MKFS_OPTIONS="-m crc=0
-b size=512", test fails. This is because crc enabled XFS was
created in the end, not 512B block size XFS with crc disabled, and
that's not what we want to test.
The reason why _scratch_mkfs_xfs creates a different XFS than
expected is that, it may ignore $MKFS_OPTIONS if mkfs fails due to
conflicts between $MKFS_OPTIONS and the provided mkfs options.
In the case of xfs/186, "-b size=512" conflicts with "-i size=512",
and the first mkfs fails, then it ends up with a 4k block size XFS
with crc enabled (the default config).
Fix it by checking crc enablement status and attr version in the
test, to make sure it's testing on expected XFS.
Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Eric Sandeen [Fri, 17 Jun 2016 17:54:43 +0000 (12:54 -0500)]
xfs/186: fix test for crc=0, ftype=1
Test 186 won't run when crcs are enabled, because
attrv1 is not allowed with crc=1.
However, ftype is still allowed with crc=0, so
this creates v3 directories, and xfs_db prints
them as such (along with the filetype), which
breaks the test output.
We can filter & replace to fix up the test in
this case.
Brian Foster [Thu, 16 Jun 2016 12:28:48 +0000 (08:28 -0400)]
fstests: support check for uuidgen utility
A recent test uses the uuidgen utility to generate UUID-based
filenames, but this package is not necessarily installed as part of
the core packages of every distro.
As such, add the UUIDGEN_PROG environment variable to the common
configuration and update the test to require the existence of
uuidgen to run.
Wang Xiaoguang [Wed, 15 Jun 2016 06:37:10 +0000 (14:37 +0800)]
ext4: regression test for fsync transaction ids initialization
Commit 688f869 fixed this bug:
ext4: Initialize fsync transaction ids in ext4_new_inode()
We manually modify jbd2 journal_superblock_s.s_sequence to be a very
large number, which will greatly reduce the time taken to trigger
this bug, though it seems some too hacked.
Lu Fengqi [Tue, 14 Jun 2016 01:42:39 +0000 (09:42 +0800)]
btrfs: check qgroup on extent de-reference
Test if qgroup can handle extent de-reference during reallocation.
"extent de-reference" means that reducing an extent's reference
count or freeing an extent.
Although current qgroup can handle it, we still need to prevent any
regression which may break current qgroup.
Darrick J. Wong [Tue, 31 May 2016 16:43:52 +0000 (09:43 -0700)]
xfs/122: don't break on old xfsprogs
If we're running against a old version of xfsprogs that lacks some
of the structures that the golden output knows about, copy the
structure size definition from the golden output to the program
output. This way we can check for structure size mutations on old
xfsprogs without generating false error reports for structs that
don't exist in the old release.
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 [Fri, 27 May 2016 03:28:51 +0000 (20:28 -0700)]
xfs: map multiple bmbt records to a single rmapbt record
Make sure that we can handle multiple bmbt records mapping to a
single rmapbt record. This can happen if you fallocate more than
2^21 contiguous blocks to a file.
(Also add some helpers that can create huge devices with some
dm-zero and dm-snapshot fakery.)
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 [Thu, 26 May 2016 05:57:36 +0000 (22:57 -0700)]
reflink: avoid reflink on swap files
Since none of the current filesystems support reflinked swap files,
make sure that we prohibit reflinking of swapfiles and swapon of
reflinked files.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Thu, 26 May 2016 05:57:29 +0000 (22:57 -0700)]
xfs: check accounting during refcountbt expansion
Ensure that refcountbt allocations during truncate operations come
from the per-AG reservation and are not charged to the transaction.
Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Eryu Guan <eguan@redhat.com>
Darrick J. Wong [Fri, 27 May 2016 03:28:05 +0000 (20:28 -0700)]
generic: don't put loop control files on the scratch mount
If we're doing write/overwrite/snapshot/resource exhaustion tests on
the scratch device, use the test directory to hold the loop
termination signal files. This way we don't run infinitely because
we can't create the flag due to ENOSPC.
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>
Theodore Ts'o [Thu, 9 Jun 2016 18:42:31 +0000 (14:42 -0400)]
shared/272: don't try to use O_DIRECT
A comment in shared/272 claims that ext4 supports O_DIRECT in
data=journalling mode. Actually, it doesn't, it was just silently
ignoring O_DIRECT, let's not try to test O_DIRECT for either ext3 or
ext4 in this test.
Theodore Ts'o [Thu, 9 Jun 2016 18:41:09 +0000 (14:41 -0400)]
defrag: test $TEST_DEV for extents for ext4 defrag
Commit 902223bdbbf2: "defrag: require extents support for ext4
defrag" added a test to make sure the ext4 file system has extents
enabled by testing the scratch device. Unfortunately at the time
when _require_defrag is run, the scratch file system hasn't been
initialized yet by the test, so its contents are undefined.
If the previous test explicitly creates a file system with extents
disabled on $SCRATCH_DEV (such as ext4/306), then subsequent tests
(e.g., ext4/307 and ext4/306) will refuse to run.
Fix this by testing $TEST_DEV instead of $SCRATCH_DEV.
Brian Foster [Thu, 2 Jun 2016 13:10:01 +0000 (09:10 -0400)]
xfs: discontiguous multi-block buffer logging test
XFS had a bug in the multi-block buffer logging code that caused a
NULL lv panic at log push time due to invalid regions being set in
the buffer log format bitmap. This was demonstrated by modifying a
multi-block directory buffer in a manner that only logs regions
beyond the first FSB-sized mapping of the buffer.
To recreate these conditions, this test fragments free space and
populates several directories with enough entries to require
discontiguous multi-block buffers. To recreate the problem, we
remove entries from the tail end of the directory and fsync to flush
the log.
Note that this test causes a panic on kernels affected by the bug.
As such, it is included in the 'dangerous' group. The bug is
resolved by kernel commit a3916e528b91 ("xfs: fix broken multi-fsb
buffer logging").
This test is inspired by a test case from Eric Sandeen, and follows
the test steps in generic/193. This test requires direct I/O, it's
not added to generic/193 but to a new test, so that generic/193
still runs on filesystems don't have direct I/O support.
Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Eryu Guan <eguan@redhat.com>
Eryu Guan [Thu, 26 May 2016 03:26:24 +0000 (11:26 +0800)]
generic/250: ignore xfs_io IO errors when writing to dmerror device
When testing with data=journal ext4, direct write to dmerror device
doesn't return EIO, because ext4 turns direct write to buffered
write in data=journal mode and all data is written to journal
buffer. The write only fails later when commiting journal and error
messages can be seen in dmesg.
As the test is checking on the md5 checksum of the test file, it's
ok to ignore the IO error returned by xfs_io, as long as the
checksums match the golden image.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Jeffrey Bastian [Wed, 18 May 2016 17:40:54 +0000 (12:40 -0500)]
build: avoid struct fsxattr redefinition
Linux kernel v4.5 defines 'struct fsxattr' in linux/fs.h [0] but
it's still defined in xfs/linux.h as a backup [1]. If the files are
included in the wrong order, the compiler will complain with a
redefinition error. This patch moves linux/fs.h (and linux/magic.h)
before the xfs headers for the t_immutable.c and fsstress.c tests.
Jan Kara [Thu, 12 May 2016 09:30:27 +0000 (11:30 +0200)]
generic: Test handling of private file mappings
Test handling of private file mappings in the kernel. Check that
writes of only one thread / process are seen in each page and that
none of these make it into the original file.
Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Eryu Guan <eguan@redhat.com>
Qu Wenruo [Mon, 16 May 2016 01:14:15 +0000 (09:14 +0800)]
generic: check fiemap SHARED flag on sync
The test case will check SHARED flag returned by fiemap ioctl on
reflinked files before and after sync.
Normally SHARED flag won't change just due to a normal sync
operation.
But btrfs doesn't handle SHARED flag well, and this time it won't
check any delayed extent tree(reverse extent searching tree)
modification, but only metadata already committed to disk.
So btrfs will not return correct SHARED flag on reflinked files if
there is no sync to commit all metadata.
Also btrfs will return wrong flag for all these extents, they should
have SHARED(0x2000) flags, while btrfs still consider them as
exclusive extents.
On the other hand, with unmerged xfs reflink patches, xfs can handle
it without problem, and for patched btrfs, it can also handle it.
This test case will create a large fully deduped file to check if
the fs can handle the fiemap ioctl and return correct SHARED flag
for any fs which support reflink.
Zorro Lang [Thu, 12 May 2016 02:55:19 +0000 (10:55 +0800)]
xfs/133-4: filter redundant projid 0 quota report info out
After GETNEXTQUOTA ioctl being supported, xfs_quota -c "report"
always outputs one more quota line about default quota (as project
ID 0). In order to fix this problem, xfsprogs has merged commit 3d607a1.
Now xfstests face this same problem from this issue. xfs/133 and
xfs/134 can't match their golden output, due to this one more line
quota report output. So this patch filters this redundant quota info
out.
There're 3 kinds of xfsprogs:
1. not support GETNEXTQUOTA
2. support GETNEXTQUOTA but not merged commit 3d607a1
3. the latest version supports all
The 1st one won't report Project ID 0, the 2nd will report projid 0
info as "(null) 0 0 0 ...", the 3rd will report projid 0 info as
"#0 0 0 0 ...". To deal with all of these situations, we will use
_filter_quota | grep -v "^#0 \|^(null) "
But if someone specifies a name for projid 0, e.g.
# cat $projid_file
# root:0
I think that means someone wants to deal with it by himself, the
common filter won't filter it out.
Signed-off-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Dave Chinner [Mon, 9 May 2016 06:03:29 +0000 (16:03 +1000)]
generic: renumber tests after merge
Some tests were merged with high, non-conflicting test numbers
(700+). Renumber them down to contiguous numbers now that all the
other tests have been added, as it's easier to do it this way rather
than having to rebase and have to fix all the conflicts early
renumbering will cause.
Eryu Guan [Mon, 9 May 2016 06:03:27 +0000 (16:03 +1000)]
fstests: fix various $seqres.full issues
There're many tests don't remove $seqres.full before writing to it, and
accumulating logs there, then the logs are always growing over time.
Let's fix them once.
generic/16[1-8] generic/170 and generic/33[34] truncate $seqres.full in
the middle of the test, which results in partial logs. Fix them as well.
xfs/227 has duplicated lines to remove $seqres.full, remove the extra
line.
Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Omar Sandoval [Mon, 9 May 2016 00:58:06 +0000 (10:58 +1000)]
btrfs: add test for replacing a missing device
Now that _btrfs_get_profile_configs supports replace missing and the
kernel doesn't crash when replacing a missing RAID 5/6 device, test it.
Based on an earlier test from Wang Yanfeng.
Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Omar Sandoval [Mon, 9 May 2016 00:57:50 +0000 (10:57 +1000)]
btrfs: add replace missing and replace RAID 5/6 to profile configs
Replacing and scrubbing RAID 5/6 is now supported on Btrfs. Enable it in
_btrfs_get_profile_configs while making it more generic to also support
replace missing.
Filipe Manana [Mon, 9 May 2016 00:57:39 +0000 (10:57 +1000)]
generic: test creating a symlink and then fsync its parent directory
Test creating a symlink, fsync its parent directory, power fail and mount
again the filesystem. After these steps the symlink should exist and its
content must match what we specified when we created it (must not be
empty or point to something else).
This is motivated by an issue in btrfs where after the log replay happens
we get empty symlinks, which not only does not make much sense from a
user's point of view, it's also not valid to have empty links in linux
(wgich is explicitly forbidden by the symlink(2) system call).
The issue in btrfs is fixed by the following patch for the linux kernel:
"Btrfs: fix empty symlink after creating symlink and fsync parent dir"
Tested against ext3, ext4, xfs, f2fs, reiserfs and nilfs2.
Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Mark Fasheh [Mon, 9 May 2016 00:57:01 +0000 (10:57 +1000)]
btrfs: Test that qgroup counts are valid after snapshot creation
This has been broken since Linux v4.1. We may have worked out a solution on
the btrfs list but in the meantime sending a test to expose the issue seems
like a good idea.
Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Xiong Zhou [Mon, 9 May 2016 00:55:52 +0000 (10:55 +1000)]
overlay: notrun if upper fs does not support d_type
Overlayfs whiteout can be visible if underlying upper fs does not
support d_type. Kernel commit 45aebea (ovl: Ensure upper filesystem supports d_type)
prevents mounting overlayfs like this since v4.6-rc1.
Check upper fs before mounting overlay, mark as not run if needs.
Xiong Zhou [Mon, 9 May 2016 00:55:44 +0000 (10:55 +1000)]
overlay: test basic whiteout
Once a while, overlayfs whiteout can be visible if upper fs
does not support d_type(ftype/filetype). Test as a sanity
check on whiteout of regular files, links, dirs, devices
and pipes.
Jan Kara [Mon, 9 May 2016 00:54:48 +0000 (10:54 +1000)]
generic/038: Avoid EBUSY errors on umount
Although the test waits for running subshells after sending SIGTERM
signal to them, it does not wait for subprocesses of those subshells
properly. Thus we can hit EBUSY errors when umount is called. Make
subshells wait for executed subprocesses when receiving SIGTERM to avoid
the problem.
Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 9 May 2016 00:54:36 +0000 (10:54 +1000)]
generic: Test races between processes doing mmap writes
Add test which spawns two processes both writing one file via mmap.
Then to the test when processes first prefault the file by reading it
via mmap. This is mainly interesting to uncover races in DAX fault
handling.
Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 9 May 2016 00:54:25 +0000 (10:54 +1000)]
generic: Test races between mmap and normal write for prefaulted ranges
Add test which spawns two threads both writing one file via mmap which
has been previously prefaulted by reading. Do the same test when one
thread accesses the file via mmap and the other one via normal write.
This is mainly interesting to uncover races in DAX fault handling and
between DAX fault handling and write path.
Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 9 May 2016 00:54:10 +0000 (10:54 +1000)]
generic: Test races between mmap and normal writes
Add test which spawns two threads one writing to file via normal write
and one via mmap and checks the result. This is mainly interesting to
uncover races between DAX fault handling and write path.
Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Mon, 9 May 2016 00:53:18 +0000 (10:53 +1000)]
generic/340: Remove second fallocate test
Currently holetest program uses both posix_fallocate(3) and fallocate(3)
to setup the file. However this unnecessarily prolongs the test run and
doesn't really bring any additional code coverage. So remove the
fallocate(3) pass as using posix_fallocate(3) allows us to make the test
easily runnable even for filesystems not supporting that (such as ext2).
Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
_scratch_ext4_populate and _scratch_xfs_populate try to create
devices directory in xfstests/, so if we run xfs/083 or ext4/006
twice, it'll fail, fix this issue.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Mark Fasheh [Mon, 9 May 2016 00:51:48 +0000 (10:51 +1000)]
btrfs: test snapshot create with invalid parent qgroup
Test that an invalid parent qgroup does not cause snapshot create to
force the FS readonly.
In btrfs, create_pending_snapshot() will go readonly on _any_ error return
from
btrfs_qgroup_inherit(). If qgroups are enabled, a user can crash their fs by
just making a snapshot and asking it to inherit from an invalid qgroup.
This patch does exactly that test. If the FS goes readonly that will be
reported and we will know that a regression was introduced.
The btrfs fix this patch relates to can be found at the following url:
http://thread.gmane.org/gmane.comp.file-systems.btrfs/54755
Thanks,
--Mark
Signed-off-by: Mark Fasheh <mfasheh@suse.de> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Zorro Lang [Mon, 9 May 2016 00:51:33 +0000 (10:51 +1000)]
xfs/299: fix variable name typo
In xfs/299, project IDs are in $tmp.projid file. But there's one
line code try to use $temp.projid. Fortunately, it doesn't bring
any problems until now, but if keep using $temp.projid it really
don't make sense.
Signed-off-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Eryu Guan [Mon, 9 May 2016 00:50:37 +0000 (10:50 +1000)]
xfs/259: test more block sizes and handle minimum block size correctly
Currently xfs/259 tests against TEST_DIR for CRC support status to
decide whether 512 block size should be tested, which is wrong for this
test, because configuration of TEST_DIR is not controlled by test
harness and can be different to the configuration being used in the
test.
Fix it by reversing the block size order that's tested and capture the
output of the actual mkfs command that is being tested, and determine if
512 byte block sizes should be tested based on that output.
While we're at it, I think the test matrix can be enlarged as well, 4k,
2k, 1k and 512 block size can be tested in each fs size boundary, not
only the minimum block size.
Suggested-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Darrick J. Wong [Mon, 9 May 2016 00:49:50 +0000 (10:49 +1000)]
block: test fallocate for block devices
Now that we're wiring up fallocate's PUNCH_HOLE and ZERO_RANGE
features for block devices, add some tests to make sure they
work correctly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Qu Wenruo [Mon, 9 May 2016 00:46:14 +0000 (10:46 +1000)]
btrfs/091: Disable compress to avoid output dismatch
If run btrfs/091 with "-o compress=lzo" mount option, test case will
fail, as compress makes extent much smaller on disk, making output
different from golden output.
As this test case is only testing qgroup, not compression, disable
compression manually in test case.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Mon, 9 May 2016 00:45:20 +0000 (10:45 +1000)]
generic: test fsync after adding a link and moving other inode
Test that if we create a hard link for a file F in some directory A,
then move some directory or file B from its parent directory C into
directory A, fsync file F, power fail and mount the filesystem, the
directory/file B is located only at directory A and both links for
file F exist.
This test is motivated by an issue found in btrfs which is fixed by the
following patch for the linux kernel:
Btrfs: fix for incorrect directory entries after fsync log replay
Tested against ext3/4, xfs, reiserfs and f2fs.
Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
The space occupied by files in the 'origin' directory is calculated with
the assumption that 4k is the block size of the underlying filesystem.
This causes the test to fail with ENOSPC errors when running on
filesystems with larger block sizes. To fix the issue, this commit makes
use of the the block size obtained from the mounted filesystem.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Dave Chinner [Mon, 9 May 2016 00:43:29 +0000 (10:43 +1000)]
config: git should ignore config files in config directory
Running a git clean on a xfstests tree causes it to remove the
config files for the given host. Make git ignore custom config
files in this directory so git clean won't completely trash the
local config needed to run xfstests.
In the most recent quota tools package, with the new project quota
support, quotaon -p prints an extra line which generic/082.out isn't
expecting. So filter it out.
Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
common: Mark tests which use direct I/O with _requires_odirect
There were a number of tests that use Direct I/O that weren't testing
to make sure O_DIRECT is actually supported. This will be important
for avoiding false positives when testing ext4 encryption (which does
not support DIO for obvious reasons).
Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Jaegeuk Kim [Tue, 5 Apr 2016 01:48:46 +0000 (11:48 +1000)]
attr: adjust acl_max of f2fs if inline_xattr is set
If f2fs gets inline_xattr, it enlarges the whole xattr space, which also enables
to cover more acl entries up to 531 from 506.
This patch detects the mount option, inline_xattr, and changes the result of
_acl_get_max for generic/026.
Fixes: 9f7bf79d0c34 ("attr: add maximum acl count for f2fs") Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
xfs/030: filter out repeated lines from .out files
Commit 31f48569c353 ("xfs/030: fix output on newer filesystems") added
more lines to .out file to match the output from XFS with reflink
support, but it broke test on older XFS.
Dave explained the reason and pointed out the correct way to fix it, so
I just quote Dave's mail here:
"The problem here is that reflink triggers a change in the initial
population of the AGFL - from 4 blocks to 6 blocks, and so repair warns
6 times instead of 4. After filtering, that gives 6 indentical output
lines instead of 4.
Doing something as simple as collapsing repeated identical lines (e.g
filtering through uniq) will work for all filesystem formats and any
future changes that modify the initial AGFL population."
Suggested-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Tue, 5 Apr 2016 01:47:55 +0000 (11:47 +1000)]
generic: add test for fsync after renaming file
Test that if we rename a file, create a new file that has the old name
of the other file and is a child of the same parent directory, fsync the
new inode, power fail and mount the filesystem, we do not lose the first
file and that file has the name it was renamed to.
This test is motivated by an issue found in btrfs which is fixed by the
following patch for the linux kernel:
"Btrfs: fix file loss caused by fsync after rename and new inode"
Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Tue, 5 Apr 2016 01:47:31 +0000 (11:47 +1000)]
generic: add test for fsync after renaming directory
Test that if we rename a directory, create a new file or directory that
has the old name of our former directory and is a child of the same
parent directory, fsync the new inode, power fail and mount the
filesystem, we see our first directory with the new name and no files
under it were lost.
This test is motivated by an issue found in btrfs which is fixed by the
following patch for the linux kernel:
"Btrfs: fix file loss caused by fsync after rename and new inode"
Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Commit 13717ffc96fe ("xfs/206: fix output when mkfs knows about
reflink") added extra lines to xfs/206.out to fit the mkfs output with
reflink support, but broke tests without reflink support.
Fix it by filtering out reflink related outputs, just like filtering out
crc related outputs in the test.
Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Josef Bacik [Tue, 5 Apr 2016 01:46:12 +0000 (11:46 +1000)]
common: replace chattr with $CHATTR_PROG
We have a wrapper around chattr to make sure people don't do the wrong thing on
their boxes, so we need to be able to specify CHATTR_PROG and have it actually
work, so replace all chattr calls with $CHATTR_PROG.
Signed-off-by: Josef Bacik <jbacik@fb.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Josef Bacik [Tue, 5 Apr 2016 01:45:41 +0000 (11:45 +1000)]
check: make results/check.log match everybody else
results/check.log is inconsistent with what goes to stdout and $tmp.summary. It
passes the ran and failed tests through fmt but not the "Not Run" tests for some
reason, and nobody else passes it through fmt. So fix this to be the same
output as what goes to stdout and $tmp.summary to make for easier post parsing.
Now we'll get
Ran: <single line with all the tests>
Not run: <single line with all the not run tests>
Failures: <single line with all the failed tests>
Signed-off-by: Josef Bacik <jbacik@fb.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Tue, 5 Apr 2016 01:45:12 +0000 (11:45 +1000)]
btrfs: add test for fsync after snapshot deletion
Test that if we delete a snapshot, delete its parent directory, create
another directory with the same name as that parent and then fsync either
the new directory or a file inside the new directory, the fsync succeeds,
the fsync log is replayable and produces a correct result.
This is motivated by a bug that is fixed by the following patch for
btrfs (linux kernel):
Btrfs: fix unreplayable log after snapshot deletion and parent
re-creation
Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Jan Kara [Tue, 5 Apr 2016 01:44:05 +0000 (11:44 +1000)]
generic/338: Add mmap race test
Add test which spawns two threads racing to write to file via mmap and
checks the result. This is mainly interesting to uncover races in DAX
fault handling.
Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Brian Boylston <brian.boylston@hpe.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Tue, 5 Apr 2016 01:42:21 +0000 (11:42 +1000)]
btrfs: test log replay with qgroups enabled and orphan roots
Test that replaying a log tree when qgroups are enabled and orphan roots
(deleted snapshots) exist, the replay process does not crash.
This is motivated by a bug found in btrfs, introduced in the linux kernel
4.4 release, and is fixed by the linux kernel commit 909c3a22da3b
("Btrfs: fix loading of orphan roots leading to BUG_ON") that landed in
kernel 4.5.
Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
===============================
tlibio.c: In function 'lio_set_debug':
tlibio.c:212:1: warning: type of 'level' defaults to 'int' [-Wimplicit-int]
lio_set_debug(level)
^
==============================
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Filipe Manana [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
overlayfs: test fsync on merged directory
Test that calling fsync against a file using the merged directory does
not result in a crash nor fails unexpectedly.
This is motivated by a change in overlayfs that resulted in a crash
(invalid memory access) when the lower or upper directory belonged to
a btrfs file system. The overlayfs change came in commit 4bacc9c9234
(overlayfs: Make f_path always point to the overlay and f_inode to the
underlay). At the moment there are two patches in the linux-fsdevel
and linux-btrfs mailing lists to fix this problem:
* vfs: add file_dentry()
* Btrfs: fix crash/invalid memory access on fsync when using overlayfs
Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Chandan Rajendra [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
btrfs: 'subvolume stress' tasks need to exit gracefully
The following scenario can occur when running btrfs/066,
Task A Task B Task C
run_test()
- Execute _btrfs_stress_subvolume()
in a background shell.
_btrfs_stress_subvolme()
...
- fork & exec "mount"
Mount subvolume on directory in $TEST_DIR
- Wait for fsstress to finish do_mount()
- kill shell process executing - btrfs_mount()
_btrfs_stress_subvolume()
i.e. Task B.
- Init process becomes the parent
of "subvolume mount" task
i.e. Task C.
- In case subvolume is mounted
(which is not the case),
unmount it.
- Complete mounting subvolume
Hence on the completion of one iteration of run_test(), the subvolume
created inside the filesystem on $SCRATCH_DEV continues to be mounted on
$TEST_DIR/$seq.mnt. Subsequent invocations of run_test() (called for
remaining Btrfs profile configs) fail during _scratch_pool_mkfs.
Instead of killing the 'subvolume stress' task this commit makes
_btrfs_stress_subvolume() to break out of the loop when a file exists
on the filesystem. The commit also makes relevant changes to other
users of _btrfs_stress_subvolume() i.e. btrfs/060, btrfs/065,
btrfs/067 & btrfs/068.
Eryu Guan [Wed, 23 Mar 2016 06:39:11 +0000 (17:39 +1100)]
xfs/073: avoid finobt warning from mkfs
When testing xfs/073 with MKFS_OPTIONS="-m crc=1,finobt=1" set, it fails
due to extra warning about disabling finobt feature:
+warning: finobt not supported without CRC support, disabled.
Because xfs/073 disables crc unconditionally and finobt can not be
enabled either.
Fix it by explicitly disabling finobt as well.
Also remove all meta related mkfs options in _scratch_mkfs_xfs_opts() if
mkfs.xfs has no metadata support, not only the crc option. So that test
still passes on distros with such old binaries.
Suggested-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
The nfs4acl tests don't make sense anymore as they have been obsoleted
by richacls.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Rename the expected output files so that they match "$TEST_NAME.out*";
this makes the file names a bit more consistent.
Add $TEST_NAME.out and similar symlinks to .gitignore.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>