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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>