Commit Graph

1253 Commits

Author SHA1 Message Date
Lukas Czerner 5715240aee xfstests: Use $MKFS_OPTIONS in _scratch_mkfs_*()
Pass MKFS_OPTIONS to mkfs.$FSTYP in _scratch_mkfs_sized().
Preserve user defined MKFS_OPTIONS in _scratch_mkfs_geom().

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redaht.com>
2010-09-29 11:23:04 -05:00
Lukas Czerner 095e690221 xfstests 224: Use $SCRATCH_MNT variable
Use $SCRATCH_MNT variable instead of hard-coded path (/mnt/scratch) in
test 224.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2010-09-29 11:21:21 -05:00
Arkadiusz Miśkiewicz 4c622795d0 Fix project quota checks
Project quota check in few tests should check SCRATCH_DEV and not
TEST_DEV. Fix that by making possible to pass device to be checked to
_require_prjquota().

Due to the problem tests didn't run with "Installed kernel does not
support project quotas" error.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-09-11 19:34:47 -03:00
Arkadiusz Miśkiewicz 903b50fad9 Don't hardcode paths to many binaries.
Stop hardcoding paths to getfattr, setfattr, attr, quota, xfs_quota,
killall, indent and xfs_copy binaries.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>

- new
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-09-11 19:34:47 -03:00
Akshay Lal 9e75fba07d xfstests 243: Test to ensure that the EOFBLOCK_FL gets set/unset correctly.
As found by Theodore Ts'o:
If a 128K file is falloc'ed using the KEEP_SIZE flag, and then
write exactly 128K, the EOFBLOCK_FL doesn't get cleared correctly.
This is bad since it forces e2fsck to complain about that inode.
If you have a large number of inodes that are written with fallocate
using KEEP_SIZE, and then fill them up to their expected size,
e2fsck will potentially complain about a _huge_ number of inodes.
This would also cause a huge increase in the time taken by e2fsck
to complete its check.

Test scenarios covered:
1. Fallocating X bytes and writing Y (Y<X) (buffered and direct io)
2. Fallocating X bytes and writing Y (Y=X) (buffered and direct io)
3. Fallocating X bytes and writing Y (Y>X) (buffered and direct io)

These test cases exercise the normal and edge case conditions using
falloc (and KEEP_SIZE).

Ref: http://thread.gmane.org/gmane.comp.file-systems.ext4/20682

Signed-off-by: Akshay Lal <alal@google.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2010-09-08 13:51:33 -05:00
Alex Elder 10835986bf xfstests: update README file to document some recent changes
Update the README file to document the new _cat_passwd and
_cat_group functions, and to recommend passing "-n" to
getfacl(1) so it produces numeric output.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-09-01 14:50:19 -05:00
Eric Sandeen 30e9f7fa67 xfstests 241: Add missing golden output
Dave reminded me of this in his review and then I forgot to
add it.  :(  But I'm taking his comment of it missing as a review
of this fix....

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-08-30 15:14:19 -05:00
Lukas Czerner a323184c77 xfstests: Show duration of current test
It may be useful to compare both times, last and current, in the
xfstests output.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-08-30 10:11:56 -05:00
Dave Chinner cebe474844 xfstests: add a test for XFS_IOC_ZERO_RANGE
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-08-23 23:10:40 +10:00
Eric Sandeen afcf8c7efd xfstests 228: suppress core dump message
When running 228 with abrt on in rhel6, I was getting different
output due to a (core dumped) message on SIGXFSZ.  For some reason
I wasn't able to use sed to filter it, and just ulimit -c 0 didn't
suppress it either.

abrt sets the core pattern to:

"|/usr/libexec/abrt-hook-ccpp /var/spool/abrt %p %s %u %c""

which apparently allows core dumps even if ulimit -c is 0, due
to the pipe.

Temporarily changing the kernel's core pattern to just plain "core"
and setting ulimit -c to 0 does suppress it.  These are reset to
original values after the test is run.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-08-20 14:27:07 -05:00
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