Commit Graph

1242 Commits

Author SHA1 Message Date
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
Alex Elder f0d2c5ec91 xfstests: randholes: hide some Irix/Linux differences more tidily
Define a macro "xfscntl()" that effectively hides the differences
between the Linux xfsctl() and Irix fcntl() kernel interfaces.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:07 -05:00
Alex Elder 3bda8549fa xfstests: randholes: rearrange fns and drop their declarations
Rearrange the functions in the file so they no longer need to be
declared at the top.  (This change involves only wholesale moves
of these blocks of code.)

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:01 -05:00
Alex Elder 803750d475 xfstests: randholes: document options a bit more
Reformat the usage message and provide a little more
information about default values and units for options
for the "randholes" command.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:04:57 -05:00
Alex Elder b5b95753cc xfstests: randholes: only allocate write buffer when needed
If nothing is being written (i.e., in "test" mode), there's no need
for "randholes" to allocate a write buffer.  But to do this we make
this series of changes:
- When "very" verbose (> 1), there's no point in printing the values
  that have just been written to the file.  They are just the file
  offset, and the buffer will not have changed between initializing
  those values and writing it out.
- If we don't print the values at those offsets, then there's no
  need to fill them in at all when we're in test mode.
- Now we only use the write buffer if we're not in test mode,
  so we can skip the allocation.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:04:52 -05:00
Alex Elder 9cf1fef239 xfstests: randholes: Fix two bugs
This patch fixes two bugs in the "randholes" test program.

First, it is possible for findblock() to return -1 if the random
block number it picks is at or above the highest in-range block
that's already been selected.  But this case isn't checked and
the value is blindly used thereafter as if it were valid.  Just
exit if this ever occurs.

Second, when the "alloconly" option is is set, blocks are
preallocated in the target file rather than actually writing them.
But unlike when the blocks are written and subsequently read, the
preallocated blocks are *not* offset by the fileoffset parameter.

I'm pretty sure nobody every noticed this because the program itself
doesn't do any verification when blocks are only preallocated.  But
it's an inconsistency and I think it ought to be fixed.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:04:46 -05:00
Alain Renaud fd612912d3 xfstests: Fix some file permission.
I notice that some of the test script do not have execute
permission. To be consistent I changed the permissions to be 755.
Can someone verify that this is valid.

Thanks.

Signed-off-by: Alain Renaud <arenaud@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-12 14:48:24 -05:00
Arkadiusz Miśkiewicz 06bd0b2f31 Don't depend on mkfs.xfs output in some tests
Tests 136 and 206 rely on mkfs.xfs output.

136 test was currently broken with hardcoded mkfs.xfs output (that
contained for example meta-data=/dev/sda8). Drop that part from
output.

Ignore projid32bit output existence for test 206.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-09 13:29:40 -05:00
Alain Renaud 82faf28da5 xfstests: make 223 use more compatible indirection operator
Hello all,

I notice while running xfstests on SLES machine that the test 223 fail
because of syntax error.

# bash 223
QA output created by 223
223: line 66: syntax error near unexpected token `>'
223: line 66: `    _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE&>>  $seq.full'

The error is due to the use of the '&>>' operator for redirection
that does not work  on older bash version(3.2.x).  Note that this
operator only seem to work with bash version 4.X+

This patch simply replace the operator with '>>  $seq.full 2>&1'
which does the same thing.

Signed-off-by: Alain Renaud <arenaud@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-01 15:58:27 -05:00
Arkadiusz Mi?kiewicz c05368d13e xfstests: test 244 to test quota project id setting overflow
Test 3 quota project setting id conditions:
- set 16bit project quota id -> should succeed
- set 32bit project quota id -> should succeed (with projid32bit
  patch applied; fail otherwise)
- over 32bit project quota id -> should always fail

Updated by <aelder@sgi.com>:
- Shortened some long lines, including failure output

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-01 15:57:58 -05:00
Christoph Hellwig 5c67a98f5d xfstests: fix 108 and enable it by default
Apply the prjquota check to the scratch device so that it doesn't fail,
and add the test to the auto and quick groups now that it works.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
2010-10-01 06:04:33 +02:00
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