tmpfs does not implement ->get_acl method, overlayfs
need to get its cached acls in permission check when
lower or upper fs is tmpfs.
CC: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
In a DAX mountpoint, do IO betwen files with and
without DAX per-inode flag. We do mmap, both
O_DIRECT and buffered read/write IO in this case.
Then test again in the same device without dax
mountoption.
Add help _require_scratch_dax to make sure we can
test DAX feature on SCRATCH_DEV.
Add mmap dio test programme to test read/write
between a mmap area of one file and another file
directly or buffered, with different size.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When I try to write cases about mount shared subtrees test, I find I
always need to do many mount operations, then then umount those
mount point one by one.
To make the code clear, I use a stack to save mounted points
sequentially, then I write 3 common functions to operate this stack.
1. The global stack named MOUNTED_POINT_STACK
2. _get_mount() accepts mount parameters like _mount() does, but the
mountpoint parameter must be the last one. It will run the
mount operation and push the mountpoint name into stack.
3. _put_mount() doesn't need any parameter. It will pop the newest
mountpoint name from the stack, and umount it.
4. _clear_mount_stack() doesn't need any parameter either. It will
umount all mountpoints in the stack sequentially, and set
MOUNTED_POINT_STACK=""
Generally, the _clear_mount_stack() function also can be used as
_init_mount_stack() at the beginning of a case. Because it will
prepare an empty stack.
[eguan: add comments and fix code style]
Signed-off-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
/dev/urandom is incompressible and, /dev/zero is highly compressible,
so both are less effective in testing the compress code logic in btrfs.
This patch introduces a text data generator
cat /dev/urandom | od
to populate the files where /dev/urandom is currently being used in the
btrfs test cases.
And updates the _populate_fs() with a new option -c, so to instruct
to use the compressible data to populate the file(s).
[eguan: add comments, fix indention]
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Create a helper function to create a populated FS image and dump the
metadata into a file on the test device, with the purpose of allowing
future (fuzzer) invocations of _populate_fs use the cached metadata to
save time.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
generic/401 failed on RHEL6.8GA because "--output=xxx"
option is not supported by df. So we remove it.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Without this the epressions in generic/256 will fail on a system
where /bin/sh is the Default (e.g. modern Debian versions).
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Some of the reflink tests try to require a specific filesystem block
size so that they can test file block manipulation functions. That's
straightforward for most filesystems but ocfs2 throws in the additional
twist that data fork block mappings are stored in units of clusters, not
blocks, which causes these reflink tests to fail.
Therefore, introduce a new helper that retrieves the file minimum block
size and adapt the reflink tests to use that instead.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add a leading underscore to the get_block_size helper since it's a
common function.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The test helps to validate clamping and mount behaviors
according to supported file system timestamp ranges.
Note that the test can fail on 32-bit systems for a
few file systems. This will be corrected when vfs is
transitioned to use 64-bit timestamps.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
_supports_filetype() helper checks if the filetype feature
is enabled for xfs and ext* file sytems.
Add a check for the generic case where we don't know
how to test file system filetype feature.
Introduce a helper utility t_dir_type that lists directory
entries filtered by file type.
Check for filetype feature by expecting to find no directory
entries listed as DT_UNKNOWN inside a test directory.
[eguan: declare temp vars as local]
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
_overlay_mount_dirs() checks for the filetype feature
on upper dir fs.
factor out that feature test to a helper.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Currently in _scratch_mkfs only xfs and ext4 could handle the mkfs
failure caused by conflicts between $MKFS_OPTIONS and mkfs options
specified by tests, because of _scratch_mkfs_xfs and
_scratch_mkfs_ext4. This is a very useful functionality that allows
tests to specify mkfs options safely and to test specific fs
configurations, without worrying about mkfs failures caused by these
options.
Now teach _scratch_mkfs to handle such mkfs option conflicts for
other filesystems too, i.e. mkfs again only with mkfs options
specified by tests. Also add the ability to filter unnecessary
messages from mkfs stderr.
Also update some btrfs tests to throw away _scratch_mkfs stdout,
because previously _scratch_mkfs did this for btrfs.
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
-c "open $f" is broken in xfs_io <= 4.8. Using it results
in an endless loop and xfs_io exists with error EMFILE.
A fix for that bug makes "open" a 'one shot' command.
Along with this fix, a new -C flag was introduced to explicitly
request to execute a one shot command.
Check for -C flag support as an indication that -c "open $f"
is not broken.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Introduce new _require_btrfs_qgroup_report function, which will
check the accessibility to "btrfs check --qgroup-report", then set a
global flag to info _check_scratch_fs() to do extra qgroup check.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Btrfs doesn't support swapfiles (yet?), so generic/356 fails
erroneously, and generic/357 only passes by accident. Let's add a
_require_scratch_swapfile helper and add it to these tests.
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc has become a dumping ground for common functions that
don't have a specific topic file. It's getting huge and difficiult
to manage, and people are duplicating functionality because they
can't easily find existing functions in the mess.
Let's start to make it a little easier to manage by splitting out
the XFS specific functions into common/xfs and source that from
common/rc automatically. Other filesytems can follow suit in
future, leaving us with only generic functionality in common/rc.
Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
There are a a few things about ocfs2 tools that need special-casing in
xfstests, so fix them so that we can start testing ocfs2.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Before xfsprogs commit a872b62 (xfs_copy: band-aids for CRC
filesystems), xfs_copy requires the "-d" option to copy a V5 XFS,
because it can't rewrite the UUID of V5 XFS properly.
Now xfs_copy already full support to copy a V5 XFS. But for above
old problem, xfstests use below patch to make sure xfs_copy always
use "-d" option to copy a V5 XFS:
8346e53 common: append -d option to XFS_COPY_PROG when testing v5 xfs
That cause xfstests miss the coverage of copying a V5 XFS without
"-d". For test this feature I did below things:
1. Changed init_rc(), add "-d" to $XFS_COPY_PROG if xfs_copy can't
copy a V5 XFS properly.
2. xfs/073 test V4 xfs forcibly by specify "-m crc=0" in case. I
think it's useless now, so remove it.
3. Changed xfs/032. If xfs_copy full support to copy a V5 XFS, test
with and without "-d" option, or only test with "-d" option.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
_test_inode_flag() and _test_inode_extsz() use "which $XFS_IO_PROG"
to check if xfs_io command is available. And "-i" option was added
to XFS_IO_PROG varibable by commit 54659ecdb5 ("fstests: run
xfs_io with -i option if supported"). So the command becomes "which
/usr/sbin/xfs_io -i", and it stops and waits for input from stdin,
because "-i" option of "which" means "Read aliases from stdin".
I've seen xfs/008 hang when testing with latest xfsprogs, where
xfs_io has "-i" support.
Fix it by removing the xfs_io command detections, and making xfs_io
mandatory in common/config.
Also fix the indentions in these functions, use tab instead of
spaces, while we're at it.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Add basic CephFS support. No new CephFS specific tests are included,
just FSTYP="ceph" enablement.
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
We re-added the UNSHARE flag to fallocate, so go make sure that all
the unshare tests actually check that the installed copy of xfs_io
supports the 'funshare' command and that the underlying filesystem
understands the flag, and change the tests themselves to use
funshare.
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>
Try to run xfs_io with command line option -i, which starts an idle
thread before performing any io.
The purpose of this idle thread is to test io from a multi threaded
process. With single threaded process, the file table is not shared
and file structs are not reference counted.
In order to improve the chance of detecting file struct reference
leaks, we should run xfs_io commands with this option as much as
possible.
Analysis of the effect of xfs_io -i on tests runtime showed that it
may lead to slightly longer run times in extreme cases (e.g +3s for
generic/132), but has a negligible effect on runtime of tests among
the 'quick' group (worst case +0.3s for generic/130).
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>