Commit Graph

1185 Commits

Author SHA1 Message Date
Dave Chinner a8fa6ee439 xfsqa: new fsr defragmentation test
This test aims to recreate the conditions that caused xfs_fsr to
corrupt inode forks. The problem was that the data forks between the
two inodes were in different formats due to different inode fork
offsets, so when they swapped the data forks the formats were
invalid.

This test generates a filesystem with a known fragmented freespace pattern and
then abuses known "behaviours" of the allocator to generate files
with a known number of extents. It creates attributes to generate a
known inode fork offset, then uses a debug feature of xfs_fsr to
attempt to defrag the inode to a known number of extents.

By using these features, we can pretty much cover the entire matrix of inode
fork configurations, hence reproducing the conditions that lead to corruptions.
This test has already uncovered one bug in the current kernel code, and the
current fsr (with it's naive attribute fork handling) is aborted on a couple of
hundred of the files created by this test.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
2010-04-28 15:34:06 +10:00
Eric Sandeen f03e512ff6 xfststests 226: test for prealloc/delalloc/reserved space recapture
Test writing and removing a file in a loop; filesize is 64m,
filesystem size is 256m.  Loop 16 times each for buffered and
direct.

ext4 hits enospc after a couple loops.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-04-16 13:20:54 -05:00
Eric Sandeen 1e4ec2a55a xfstests: make sure $seq.full files don't land in /
186 and 192, at least, were landing (part of) their $seq.full
files in /

Fix this by using $here/$seq.full where needed.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-04-16 11:36:22 -05:00
Lukas Czerner 9a496ba1f8 xfstests: 125: run ftrunc with relative path
Since ftrunc is invoked with su $qa_user, it can fail when absolute path
is not accessible to everyone.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
2010-04-16 10:50:01 -05:00
Christoph Hellwig b90c485fd0 xfstests: don't use -s option to repquota
The -s option to repquota used to be a no-op, but actually changes
output to different units in quota tools 4.0.  Remove it from the
repquota invocation in test 219.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Tested-by: "Theodore Ts'o" <tytso@mit.edu>
2010-04-05 21:48:52 +02:00
Eric Sandeen 9d9081821d xfstests: exit non-0 if fs check fails
Right now if any of the _check_scratch_fs tests etc fail,
the check script exits but with 0 status.

This change will cause the status to be non-0 so we can detect
the error.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: David Chinner <david@fromorbit.com>
2010-03-31 22:01:11 -05:00
Eric Sandeen b2fd1f3f27 xfstests: use $TEST_DIR in 225
Oops, another hard-coded /mnt/test

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-24 11:11:51 -05:00
Eric Sandeen 64f2b6a153 xfstests: drop readlink of test devices
Comments say it's for devfs; it's actually breaking lvm devices, now.
I think we can just drop it.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-24 11:12:32 -05:00
Eric Sandeen 5bd1146450 xfstests: filter 203 mount point
Right now this only works if TEST_DIR == /mnt/test

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-24 11:14:16 -05:00
Lukas Czerner 833f57c0ad xfstests: avoid blkid cache with -c /dev/null not -p
The addition of "-p" to blkid calls broke xfstests
on older systems where this was not supported.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-12 09:26:38 -06:00
Dimitry Monakhov 0dba87f0f7 xfstests: fix log filtering in 223's testcase
Msg filter was missed in one place, so test failed if
$SCRATCH_MNT is different than /mnt/scratch.diff 

Signed-off-by: Dimitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
2010-03-09 11:59:46 -06:00
Dave Chinner 544262ae10 xfsqa: define resblks for tests near ENOSPC
Several tests assume a certain amount of disk space free after the
reserve block pool is filled. Changing the default size of the
reserve block pool breaks these tests because there is less space
available that first thought.

Change these tests to specify a known reserve block pool size of
1024 blocks to ensure that they continue to work correctly even if
the default size changes.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-06 11:25:10 +11:00
Eric Sandeen db5926819a xfsqa: Add fiemap exerciser
Preliminary fiemap testing support based on a test util written by
Josef Bacik.

For now it's only run with preallocation disabled, because xfs has a
tendency to fill in holes with data blocks (EOF prealloc stuff I
think) and similar for explicit preallocation, so this is breaking
the preallocation tests for now, when it finds a "data" block where
it expects a preallocated block.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-06 11:24:54 +11:00
Dave Chinner b2de346746 xfsqa: fix size specification for scratch mkfs
When making a specifically sized scratch filesystem, we need to
calculate the size rather than assigning the caclculation expression
to a variable and passing that into the _scratch_mkfs_sized
function. Currently sized filesystems are failing to be made and the
code is falling back to full sized filesystems so we are not testing
enospc issues correctly.

Signed-off-by: Dave Chinner <david@fromorbit.com>
2010-03-06 11:24:38 +11:00
Dave Chinner 56cc8b05d4 xfsqa: add delayed allocation @ ENOSPC exerciser
When we deplete the reserve block pool or receive an error during
delayed allocation, we currently toss the page away. If that page
has delayed allocation extents on it, we can fail to remove them and
leave stale delayed llocation extents lying around on the inode.
This can, in certain circumstances, trigger errors later on when the
stale delalloc extent it found again, including tripping a BUG().

Exercise this failure path so that we get code coverage of the fix
that prevents stale delalloc mappings from being left on the inode
when pages are tossed.

This is based on a test case supplied by Lachlan McIlroy.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-03-06 11:22:58 +11:00
Eric Sandeen f2e62aadc3 xfstests: don't delete scratch loop device w/ umount -d
Recent fixes to 073 added umount -d, but if we happen
to be using a scratch device on loopback, subsequent
tests get very, very unhappy when their loopback block
device goes away!

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-19 09:34:33 -06:00
Eric Sandeen 3839d29973 xfstests: mount xfs with a context when selinux is on
When selinux is on, we get tons of new xattrs, which messes
up all kinds of output.

The simplest way out of this, for now, seems to be to just mount
with a global context instead and skip writing the extra xattrs.

I've been using this internally on Fedora and RHEL for a while now.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Dave Chinner <david@fromorbit.com>
2010-02-19 09:33:45 -06:00
Eric Sandeen 7ff755f651 xfstests: 077 should require fsgqa user
Running on a newly-provisioned box:

077	 - output mismatch (see 077.out.bad)
 --- 077.out	2010-02-17 11:22:35.275052872 -0500
 +++ 077.out.bad	2010-02-17 11:59:48.979053106 -0500
 @@ -1,6 +1,7 @@
 QA output created by 077
 *** create filesystem
 *** set default ACL
+setfacl: Option -m: Invalid argument near character 3
 *** populate filesystem, pass #1
 *** populate filesystem, pass #2
 *** all done

because we didn't have the fsgqa user, and tried:

# setfacl -R -dm u:fsgqa:rwx,g::rwx,o::r-x,m::rwx ...

instead should have had:

077	 [not run] fsgqa user not defined.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-19 09:32:54 -06:00
Christoph Hellwig c8eedb0fe9 xfstests: use blkid raw mode
blkid without options usually gets no probe results at all just after
creating a filesystem.  This problem is due to the cache that blkid
uses in it's default mode, and is unlikely to get fixed.  Use the -p
option to bypass the cache layer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
2010-02-15 10:01:21 +01:00
Christoph Hellwig 70d277327e xfstests: fix awk syntax error in 219
There's one brace too many here - this was pointed out in the review
but slipped back into the commited patch.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
2010-02-15 10:00:46 +01:00
Alex Elder 90eed13c43 xfstests: fix some warnings
Fix a couple of build warnings.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-13 09:59:49 -06:00
Alex Elder caab36f192 xfstests: 219: fix awk filter for duplicate users
The filter I added for removing duplicate users from the
output of repquota didn't do the job very well.  This
fixes that, making it so the first time a user is seen
its line is printed, not thereafter.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-12 14:47:18 -06:00
Eric Sandeen 2e57a3e0d7 xfstests: make 204 generic
204 can be generic.

Also remove a stray _scratch_mkfs that snuck into
_scratch_mkfs_sized :/

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-09 16:05:51 -06:00
Eric Sandeen 917658170c xfstests: fix up fs_perms test used by 126
Test 126 was failing intermittently for Ted & I; it seems that
this is because we were passing an unterminated string to
fopen for the mode; I'm not certain why this made it fail,
but it's pretty clearly not a good thing to do, and fixing
it fixes the test.

Rather than passing around characters, do things string-wise,
since that is what is ultimately used in fopen().

Reported-by: Theodore Tso <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-09 11:59:23 -06:00
Eric Sandeen 1728089cc9 xfstests: rename _acl_requirements to _require_acls
Most requirement tests are named _require_foo, so just
make this more consistent.

Also remove a few redundant tests for /usr/bin/chacl
since _require_acls covers that.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-05 11:04:10 -06:00