this is a test
xfstests: add missing colon in _filter_ln

On distros with older coreutils(eg. RHEL5) generic/294 fails like

    -ln: creating symbolic link `SCRATCH_MNT/294.test/testlink': File exists
    +ln: creating symbolic link `SCRATCH_MNT/294.test/testlink'File exists

_filter_ln ate the ": ". xfs/103 has similar issue. Add ": " back.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
xfstests: Fix test wildcard expansion.

Before commit 38d58591 "xfstests: fix typo in check",
check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:

'if grep "^$testname" $group_file >/dev/null'
returns the contents of $group_file because $testname="".

Therefore xfs/[0-9]?? was echoed to $tmp.list

Change to use egrep to fix the parsing.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
xfstests 285: Fix indentation of do_pwrite

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
two times of modifed of readme
hh
xfstests: fix seek_sanity_test for fs w/o fallocate

currently the seek_sanity_test (generic/285) fails on ext3
or ext2 due to fallocate() failures.  Just ignore that test
if the fs doesn't support fallocate.

Note: this patch was originally submitted by Zheng Liu. 
http://oss.sgi.com/archives/xfs/2013-05/msg00534.html

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Zheng Liu <gnehzuil.liu@gmail.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
xfstests 285: Fix test for ext4 in some configurations

In some configurations (e.g. 1 KB block size), ext4 can decide it is
better to zero out several blocks rather than splitting unwritten
extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
test fails. Fix the problem by disabling the feature for this test.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
xfstests 285: Test offsets over 4GB

Test whether SEEK_HOLE and SEEK_DATA works correctly with offsets over
4GB, 8TB, and 16TB.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Merge branch 'master' of git://oss.sgi.com/xfs/cmds/xfstests into test
xfstests: generic/193 runs tests in wrong location

generic/193 runs the test in $here - the root of the xfstests source
tree/installation. IOWs, it doesn't test the filesystem on either
the TEST_DIR or SCRATCH_MNT, and so it not testing the filesystem
we think it is testing. Bad. Fixing this is the majority of the
change - introducing $test_root and $test_user for the files with
different owners, and then redirecting error output and filtering
the output appropriately.

And then add checks that truncate clears the suid/sgid bits
appropriately, something that has never been tested on XFS (and
likely other filesystems) so will cause kernels between 3.1 and 3.9
to assert fail as Dave Jones has recently reported.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: xfs/253 doesn't use seqres correctly

It was missed when converting all the tests as it was using
${seq}.full and none of the regexes matched it. Fix it up to direct
the output to the correct place.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: fsync-tester: fix pwrite() return check and disable direct for test 19

Test 19 in direct mode was failing on xfs because it was not actually doing the
write because the writes were not sectorsize aligned.  This test is to test
btrfs's inline extent fsync()ing so the writes won't be sectorsize aligned, and
inline extents will fall back to buffered anyway so direct mode is meaningless
for this test.  So just check if we are test 19 and disable direct mode so we
don't have to change the golden output.  Also change test_five() to compare
against a ssize_t instead of a size_t since apparently comparing against size_t
makes it cast the return value of pwrite() to size_t which screws up the error
case, so instead of seeing the pwrite() error on xfs which would have explained
this all it appeared as if it was succeeding and screwing up the fsync(), which
unfortunately wasted a bit of Daves time.  This patch should fix all this up.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: aio-stress is calling pthread_join incorrectly

The retval parameter to pthread_join() is a pointer to a pointer.
aio-stress is passing in a pointer to an int. This can result in a bus
error on sparc64 when the pointer is not aligned on a 64-bit boundary.
Since the return value is not used, it is simplest to pass a NULL
pointer instead.

This has been fixed in the LTP source:
https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: .gitignore: add fsync-tester

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>

[bpm: fixed alphabetization]
xfstests: use xfs_io fiemap instead of filefrag V2

Btrfs has always failed shared/218 because of the way we allocate extents on
disk.  The last part of 218 writes contiguously holey from the start of the file
forward, which for btrfs means we get 16 extents but they are physically
contigous.  filefrag -v shows all 16 extents, but prints out that there is 1
extent, because they are physically contiguous.  This isn't quite right and
makes the test fail.  So instead of using filefrag use xfs_io -c fiemap which
will print the whole map and then get the count from there.  With this patch
btrfs now passes the test, I also verified that ext4 and xfs still pass this
test.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests generic/313: test ctime and mtime are updated on truncate and ftruncate

Regression test for commit:
3972f26 btrfs: update timestamps on truncate()

Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: fix README, FSTYP options

commit cbcc88fb changed test selection to use shell globs, so fixup the
examples given in the README file.

remove options for FSTYP other than NFS since the FSTYP will be automatically
detected (on Linux) from $TEST_DEV.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstest: ensure small symlink is removed

Tests the XFS symlinks that are small enough to be in the
inode, but were move to a remote symlink due to an extended
attribute were correctly removed.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: generic/314, test sgid inheritance on subdirs

Tests if subdirectories created on the filesystem will properly inherit sgid bit
when this is set on the parent directory, once the process has the properly
permissions to create a subdirectory, this, should inherit parent's sgid bit if
this is set and irix_sgid_inherit sysctl is disabled.

V2: add missing source of "attr" file for _require_acls

V3: use _ls_l to filter out the selinux "."
    renumber to 314 to make the merge easier

V4: fix 314.out to the correct output

Thanks to Sandeen who have written this patch

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
xfstests: exit out if _scratch_mount fails

I test some of the different mkfs options for btrfs, one set doesn't work
properly with small file systems, so the fs won't mount.  This is fine from a
btrfs point of view, but tests that fail to mount the scratch fs will run
anyway, so if it's a "fill the fs" sort of test this will wreak havoc.  To fix
this just error out of _scratch_mount fails.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>