Commit Graph

2584 Commits

Author SHA1 Message Date
Eryu Guan 497363b789 fstests: introduce _exclude_scratch_mount_option helper
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>
2016-06-24 12:54:01 +08:00
Anand Jain bbb351f8e5 btrfs/006: ignore btrfs filesystem sync stdout output
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

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-24 12:23:38 +08:00
Eryu Guan 6842811457 overlay: create new file over whiteout
Create file/dir over whiteout by another user, uid/gid of the
file/dir should be current fsuid/fsgid, not the mounter's.

This upstream kernel patch fixed the issue
d0e13f5 ovl: fix uid/gid when creating over whiteout

Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-23 20:18:32 +08:00
Eryu Guan b3b54d0d9e overlay: getcwd() after a failed rmdir
Test getcwd() failure after unsuccessful rmdir, the getcwd() call
should return the correct path.

Upstream commit ce9113bbcbf4 ("ovl: fix getcwd() failure after
unsuccessful rmdir") fixed this issue.

Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-23 20:18:29 +08:00
Eryu Guan 4fb7f2da7c overlay: test visible whiteout issue after rename
Test visible whiteout issue after renaming file from lowerdir to a
dir in upperdir.

Upstream commit 45d117389696 ("ovl: ignore lower entries when
checking purity of non-directory entries") fixed the issue

Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-23 20:18:07 +08:00
Andreas Gruenbacher 733f096c9c generic/026: This test doesn't require runas
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-23 17:52:43 +08:00
Eryu Guan 3832affdc9 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>
2016-06-22 10:31:41 +08:00
Eryu Guan a173f8e66d 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>
2016-06-22 10:28:18 +08:00
Eric Sandeen 619f648268 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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-21 13:59:11 +08:00
Brian Foster 3ba258d97e 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.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-21 13:54:44 +08:00
Qu Wenruo 5f02db6f02 btrfs: qgroup handling on data extents balance
Btrfs after v4.2 kernel will leaks qgroup numbers for relocated data
extents, due to the design of tree block direct swap.

This test case will check if such data balance will corrupt qgroup.

Reported-by: Mark Fasheh <mfasheh@suse.de>
Reported-by: Filipe Manana <fdmanana@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 16:46:12 +08:00
Eryu Guan 3cd0566bdc generic: check remount on I/O errors
XFS had a bug to hang on remount in this case, this kernel commit
fix the issue.

5cb13dc cancel the setfilesize transation when io error happen

Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 16:35:20 +08:00
Eryu Guan 782bd26015 generic: check symlink to very long path
Test symlink to very long path, so that path could not be hold in
inode, then check symlink file contains correct path.

There was a bug in CRC XFS, that the path in remote symlink was not
correct, this issue is fixed by this kernel commit

2ac56d3 xfs: fix remote symlinks on V5/CRC filesystems

Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 16:35:20 +08:00
Wang Xiaoguang 1f800db1fd 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.

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 16:35:20 +08:00
Guangwen Feng 4de189ad2e shared: check corrupted orphaned inode list handling
Commit c9eb13a fixed this bug:
	ext4: fix hang when processing corrupted orphaned inode list

Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 16:35:20 +08:00
Lu Fengqi c8868d94e9 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.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:55:25 +08:00
Masayoshi Mizuma 2fb853cd58 fstests: add _require_command check to killall
Some tests use killall command, but killall may not exist.
We should check whether killall exists or not.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:44:49 +08:00
Darrick J. Wong c0c6e54ce6 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>
2016-06-15 15:44:49 +08:00
Darrick J. Wong 44b9337e09 reflink: change block sharing with constant refcount
Ensure that we can handle the case where the refcount stays the same
even though the actual sharers changes.

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>
2016-06-15 15:44:49 +08:00
Darrick J. Wong ffad9122b6 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>
2016-06-15 15:44:49 +08:00
Darrick J. Wong 12c5657cfa 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>
2016-06-15 15:44:49 +08:00
Darrick J. Wong 0199ca71d5 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>
2016-06-15 15:44:49 +08:00
Darrick J. Wong b1e1b5fc8e xfs: recover copy-on-write leftover
Test recovery of CoW leftovers in xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:44:49 +08:00
Darrick J. Wong 478f75b0d0 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>
2016-06-15 15:44:49 +08:00
Darrick J. Wong b5e26de924 xfs/104: don't enospc when ag metadata overhead grows
Adapt to different metadata overhead sizes by trying to reserve
decreasing amounts of disk space until we actually succeed at it.

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>
2016-06-15 15:44:49 +08:00