Commit Graph

1263 Commits

Author SHA1 Message Date
Zhong, Xin 6a491acde9 xfstests: pwrite hang when writing from mmaped buffer of the same page
The problem is found in meego testing on btrfs:
http://bugs.meego.com/show_bug.cgi?id=6672

Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
Reviewed-by: Hellwig, Christoph <hch@infradead.org>
Reviewed-by: Chinner, Dave <david@fromorbit.com>
2010-12-16 11:09:39 +01:00
Boris Ranto ad1628eb39 xfstests: filter spaces in xfs_quota output in test case 108
xfs_quota can output different amounts of spaces when it is trying to align
its output. This can cause output mismatch on several systems in test case 108.

Filter all the consecutive spaces in xfs_quota output to just one space,
making the test case independent of the alignment.

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-12-15 20:10:57 +01:00
Boris Ranto db6661d521 xfstests: ignore absolute address in filename in test case 237
Test case 237 checks for setfacl output. The setfacl can use both
relative address or absolute address for filename.

Following patch ignores the unnecessary part of absolute address and
therefore the test case can pass on systems that output absolute
address.

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-12-14 20:17:16 +01:00
Boris Ranto 084dc325db xfstests: getfacl -n unsupported in older acl package
Test cases 051 and 067 use getfacl with option -n. This works well on newer systems but older acl package know only its longer version: --numeric.

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-12-01 15:14:56 +01:00
Josef Bacik 01c93ec817 xfstests: add _scratch_mkfs_sized support for btrfs
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-11-30 23:22:36 +01:00
Josef Bacik e6ac073fab xfstest 245: accept ENOTEMPTY as a valid error
Test 245 only checks to see if the rename returned EEXIST, but according to the
rename(2) manpage, ENOTEMPTY is also a valid result, which is in fact what Btrfs
returns.  So just filter the output for ENOTEMPTY so that either EEXIST or
ENOTEMPTY will pass the test.  It's not pretty I know, but I couldn't really
figure out a good way to get an either/or output to compare.  With this fix
Btrfs now passes 245.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-11-30 23:22:34 +01:00
Lachlan McIlroy 388144a049 xfstests 247: Test for race between direct I/O and mmap
A customer reported a problem:

If a process is using mmap to write to a file on an 
ext4 filesystem while another process is using direct 
I/O to write to the same file the first thread may 
receive a SIGBUS during a page fault.

A SIGBUS occurs if the page fault tries to access a 
page that is entirely beyond the end of the file but 
in this test case that should not be happening.

Signed-off-by: Lachlan McIlroy <lmcilory@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-11-19 10:17:34 -06:00
Christoph Hellwig 7f71f3ac17 xfstests: check block truncation after write failure
Extraced from  https://bugzilla.kernel.org/show_bug.cgi?id=22452
"data corruption after mmap()ing a file and writev() some data to another file"

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Dave Chinner <david@fromorbit.com>
2010-11-19 15:57:05 +01:00
Boris Ranto a9f5ef25fb xfstests 223: reinitialize MKFS_OPTIONS
Test case 223 constantly fails because the variable carrying mkfs
options is not being reinitialized.

Test calls function _scratch_mkfs_geom repeatedly in for loop without
cleaning the MKFS_OPTIONS variable. Since _scratch_mkfs_geom only
appends options to the variable, MKFS_OPTIONS looks like this in 5th
iteration:
MKFS_OPTIONS="-bsize=4096-b size=4096 -d su=8192,sw=4-b size=4096 -d
su=16384,sw=4-b size=4096 -d su=32768,sw=4-b size=4096 -d
su=65536,sw=4-b size=4096 -d su=131072,sw=4"

It is also easy to see that _scratch_mkfs_geom does not append leading
space when it appends the variable.

Following patch fixes the issue for me and based on my testing does not
break any other test case:

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2010-11-17 20:44:57 -06:00
Christoph Hellwig 3766237495 xfstests: add test for renaming over non-empty directories
Per Posix renames over non-empty directories should fail, but hfsplus used to
allow this (and corrupt the filesystem while doing so).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-11-09 14:53:39 +01:00
Christoph Hellwig 77fe563a78 xfstests: add _require_sparse_files
Add a helper to check if the filesystem supports sparse files.  This is
used to guard tests that exercise sparse file functionality and would
take forever on filesystems that have to zero all blocks on extending
truncates.

Unfortunately there's no good way to autodetect this functionality, so
just implement it as a blacklist for now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-11-09 14:53:36 +01:00
Christoph Hellwig 3d3893eef9 xfstests: do not call attr/getfattr/setfattr direcly
always use the full path set up in common.attr.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-25 10:17:26 -05:00
Christoph Hellwig d0b69e2ee6 xfstests: remove dead code in test 062
The _linux_attr_calls function is never called, remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-25 10:17:14 -05:00
Alex Elder b88bd861f2 xfstests: use a common _filter_test_dir function
Christoph Hellwig suggested that a function similar to the common
"_filter_scratch" function ought to be created to handle filtering
of the TEST_DIR and TEST_DEV variables.  This patch implements that.

The name "_filter_test" seems like it might suggest it does
something different, so I'm calling this one "_filter_test_dir".
This unfortunately makes the "test" and "scratch" functions have
different naming conventions, but I guess we should be accustomed to
that by now (consider "TEST_DIR" and "SCRATCH_MNT").

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-10-25 10:15:58 -05:00
Alex Elder 580b0a9386 xfstests: use a common _filter_scratch function
There are a number of tests that use a shell function called
"filter_scratch" or "_filter_scratch" in order to have the actual
scratch device or mount point show up in test output with a symbolic
name.  There are two sets, each following a slightly different
convention.  Put a common _filter_scratch function definition in
"common.filter" and have all test scripts use that instead.
Choosing one of the two conventions meant that a few test output
files had to be changed.

In addition, add a call to _filter_scratch to test 185, and update
its output accordingly.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-10-22 09:13:06 -05:00
Christoph Hellwig bd77e7c5bf xfstests: handle filesystems without FIEMAP support
Do a _notrun in 225 if we get EOPNOSUPP back from FIEMAP instead
of failing the test.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-10-21 21:12:04 +02:00
Christoph Hellwig 5411ceb991 xfstests: add _require_attrs
Add a new helper to check if extended attributes are supported.  It
errors out if any of the attr tools are not found, or if a filesystem
does not support setting attributes.

Remove the opencoded checks for the attr tools from various tests
now that we do them in common code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-21 21:11:48 +02:00
Christoph Hellwig f1436346b4 xfstests: fix quota detection
Even if the kernel has quota support built in most filesystems still
don't support it.  As there's no good way to find out if a filesystem
supports quotas hardcode the list of filesystems that do support
quotas.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-21 05:55:58 +02:00
Christoph Hellwig 15e17c9bac xfstests: fix _require_acl
Skip ACL tests if we get EOPNOTUPP back from the acl calls.  This is
the error code we get on a kernel that does support the xattr system
calls, but does not support the attributes used to handle Posix ACLs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-21 05:55:11 +02:00
Alex Elder 506621696a xfstests: randholes: a few final cleanups
Minor bits to wrap up this series.
- Bumped up the number of blocks read at once from 10 to 256
- Shorten remaining long lines
- Re-factor findblock()
- Get rid of global variable "nvalid"
- Add a few more comments
- Give all global symbols static scope
- Update the copyright message
- Various other minor formatting changes.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:37 -05:00
Alex Elder 97d57710d2 xfstests: randholes: encapsulate argument parsing
Move the argument parsing code out of main() and into a separate
parseargs() routine.  The name of the target file for the test
is returned by parseargs() if no error occurs.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:32 -05:00
Alex Elder 61591161e4 xfstests: randholes: clean up readblks()
Make readblks() a bit more readable by computing a few things
into local variables, and pulling out a few of the comma-separated
expressions that were previously in the for loop headers.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:27 -05:00
Alex Elder d2c56a9fb9 xfstests: randholes: encapsulate realtime setup code
Encapsulate the code that sets up the use of files on the realtime
volume.  Using realtime implies direct I/O; move the code that makes
that so into the argument parsing code.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:22 -05:00
Alex Elder 4099869db4 xfstests: randholes: use posix_memalign()
Use posix_memalign() rather than memalign() regardless of whether
direct I/O is to be used.  Don't store the dioattr data in a global
variable.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:17 -05:00
Alex Elder cccbdd0d08 xfstests: randholes: encapsulate direct I/O setup code
Pull the code used to get alignment information for direct I/O into
a separate function.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:11 -05:00