Commit Graph

1218 Commits

Author SHA1 Message Date
Eric Sandeen d3942f5a09 xfstests 241: run parallel dbench
ext4 was corrupting inode table bitmaps due to a mishmash of
atomic & nonatomic bitops.  This got broken twice and fixed
twice; let's add a test.

On a 4-way box this reliably ends up with a corrupted filesystem
if we get it wrong (upstream as of 2.6.35 at least is fine again)
    
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Dave Chinner <david@fromorbit.com>
2010-08-20 14:15:50 -05:00
Dave Chinner 3a3dfc5a67 xfstests: fix NIS detection damage
NIS detection wasn't tested on machines without NIS enabled, so many tests are
failing on non-NIS machines. the _yp_active function has no specific return
value so always evaluates as 0 (active) and the "_cat_passwd" function is
called from within an awk script which is not valid as the shell may run with a
sanitised environment. Hence the functions do not need specific export calls,
either, as unsanitised subshells will automatically inherit the parent's
environment.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-08-13 15:45:24 +10:00
Alex Elder 2294e28218 xfstests: fix depend targets
There's no need to re-make the dependency files all the time.  Make
it so the "depend" target rebuilds the ".dep" file only if necessary.
Also change the name of the dependency file created for "ltdepend"
to be ".ltdep".

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-08-03 09:23:00 -05:00
Alex Elder 0629d83588 xfstests: have getfacl(1) report numeric id's
This patch arranges for calls to getfacl(1) to be given the "-n"
flag, which requests that user and group id's be listed numerically
rather than using names.  The affected test output files are also
updated to indicate the effect of the change.

This eliminates some spurious output differences I was seeing, due
to the presence of NIS in my test environment.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-08-02 12:15:31 -05:00
Alex Elder cda0cb20ac xfstests: include NIS databases
If NIS is active on a test target system, additional password and
group file information is available via their respective databases
in NIS.  Currently, some tests assume that /etc/passwd and /etc/group
are the only places to find this information.

This patch causes both the local database and the NIS database (if
one is likely to be present) to be consulted for needed information.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-08-02 12:14:54 -05:00
Eric Sandeen b05ae2d653 xfstests 240: test non-aligned AIO hole-filling
This replicates file corruption we've seen with qemu-kvm when
we use if=virtio,cache=none,aio=native for IO to a sparse
ext4- or xfs-hosted file, and the partitions/filesystems
within that file image are not block-aligned.  (think sector
63 here...)  This results in AIO IOs not aligned to the
filesystem blocks.

This test modifies aiodio_sparse2.c to add an option to start
the file IO at an offset.

When we do 4k writes to a 16k file in 2 threads, starting
at offset 512, we get 0s interspersed in the file where they
should not be:

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000200  01 01 01 01 01 01 01 01  01 01 01 01 01 01 01 01  |................|
*
00001000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001200  01 01 01 01 01 01 01 01  01 01 01 01 01 01 01 01  |................|
....

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-07-23 11:18:59 -05:00
Jan Kara 034110b37d Add test for correct $SCRATCH_MNT into _require_scratch
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-07-21 18:52:31 +02:00
Jan Kara 176002236e Provide generic function for checking quota usage
Provide generic function _check_quota_usage for checking whether quota usage
matches the space used and use it in proper tests.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-07-21 18:52:31 +02:00
Christoph Hellwig 37b7b5a9e1 xfstests: test the aio unwrittent extent conversion race
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-07-14 04:38:58 +02:00
Dave Chinner 44e51274c7 xfsqa: test 214 leaves files around that cause 236 to fail
Test 214 and 236 use the same file names for test files in the TEST
filesystem and don't check/create clean initial test state. Hence if
you run 214 then 236, 236 will fail with:

+link: cannot create link `/mnt/test/ouch2' to `/mnt/test/ouch': File exists
+ctime: 1277076527 -> 1277076527 
+Fatal error: ctime not updated after link

Ensure that both tests clean up after themselves properly and also
ensure a clean state before they start.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-06-25 08:25:56 +10:00
Dave Chinner 794798fa74 xfsqa: test open_by_handle() on unlinked and freed inode clusters
When Christoph and I were discussing bulkstat coherency on IRC, we
realised that inode lookup from bulkstat was not actually looking up
the inode allocation btree in xfs_imap() before reading the inode
buffer from disk in xfs_iread(). Bulkstat uses the same lookup
mechanism as handle validation to avoid shutting down the filesystem
if inode numbers that point to non-inode buffers (i.e. invalid) are
passed in the handle.

The problem with this is that when we delete inodes from disk and we
remove the inode chunk (i.e. deallocate inodes) we mark both the
inodes in memory and the cluster buffer as stale, thereby preventing
it from being written back to disk. The result of this is that some
number of inodes remain on disk looking like allocated, in use
inodes (i.e.  di_mode is not zero).

Hence if we get a cold cache lookup from a stale handle that
references such an inode, we can read the inode off disk even though
it has been deleted because we don't check if the inode is allocated
or not.  If the inode chunk has not been overwritten, then the inode
read will succeed and the handle-to-dentry conversion will not error
out like it is supposed to. The result is that stale NFS filehandles
and open_by_handle() will succeed incorrectly on unlinked files for
cold cache lookups.

This is a bug that has been present ever since the inode chunk
deletion code was implemented. This test exercises the problem and
documents the hoops you have to jump through to reproduce it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-06-25 08:26:25 +10:00
Shi Weihua 96c0dfc5ab xfstests: add check for setfacl by non-owner
Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-05-27 21:16:43 +02:00
Shi Weihua b5f3e4df9d xfstests: check for ctime updates on link(2)
Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-05-27 21:16:29 +02:00
Christoph Hellwig 46f8af36ab Merge branch 'quota-tests' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/xfstests-dev/ 2010-05-27 17:56:37 +02:00
Jan Kara fb0eb99cb4 Make test 229 XFS specific
Only XFS supports directory 'extsize' feature.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:56 +02:00
Jan Kara 20530a3062 Add test for quota accounting after remount read only
Check that quota accounting works after remounting read-only and
then back read-write.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:56 +02:00
Jan Kara 55198907bb Add test of quota limit and info setting
Add test stressing addition and removal of quota structures and setting
of quota grace time.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:56 +02:00
Jan Kara 73bce87319 Add quota accounting test when fsstress is run and quota limits are set low
Test various error recovery paths whether they properly handle EDQUOT failures.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:56 +02:00
Jan Kara bb1911020f Add quota test with fsstress
Run fsstress and verify that quota accounting is correct after it finishes.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:56 +02:00
Jan Kara d3714f7f76 Add test of quota accounting using fsx
Run fsx (and also several fsx threads in parallel) and verify that
quota accounting is correct after they finish.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:56 +02:00
Jan Kara a764d7b39f Test basic quota enforcement
Add a test which checks whether basic quota enforcement works.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-25 22:37:45 +02:00
Alex Elder 8a08cc2d67 xfstests: 226: have xfs_io use bigger buffers
By default xfs_io uses a buffer size of 4096 bytes.  On test 226,
the result is that the test runs much slower (at least an order
of magnitude) than it needs to.

Add a flag to the "pwrite" command sent to xfs_io so it uses
larger buffers, thereby speeding things up considerably.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
2010-05-25 12:42:19 -05:00
Jan Kara 2a7c4917c9 Fix fallocate() test
The test for fallocate was broken because it used $TEST_DIR/$tmp.io. Because
$tmp is usually something like /tmp/1234 or /mnt/1234 the file cannot be
created and xfs_io fails regardless of existance of fallocate support. Moreover
the subsequent message parsing decides that fallocate is actually supported
because it does not expect this message.

Fix the test to not use $tmp.

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24 11:46:44 +02:00
Jan Kara c9ff0c0447 Fix test whether kernel supports quotas
For all 2.6 kernels presence of quota support in kernel can be detected by
checking /proc/sys/fs/quota. This is actually more reliable than trying to
mount a filesystem with quota options (for example because SCRATCH_DEV does
not have to contain a filesystem type we are going to test).

Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-20 19:06:15 +02:00
Christoph Hellwig f73e0fb3f2 xfstests: test extent size hints
This is an adapted version of the reproduced in OSS BZ #874, which
shows file corruption when using the extent size hint.

Signed-off-by: Geoffrey Wehrman <gwehrman@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-05-10 19:39:04 +02:00