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