Commit Graph

1450 Commits

Author SHA1 Message Date
Boris Ranto 1844fe5e7e 259: Test xfs fs creation with fs size close to 4 TB
mkfs.xfs failed to create xfs filesystems with 4 TB minus few bytes due
to round up error in mkfs.xfs code.
This test case is a regression test for the fs creation problem.

I've tested the test case with mkfs.xfs patch (in the form posted by
Eric Sandeen) and the test passed (and therefore the patch fixed the
issue for me).

I'm not sure whether bash guarantees at least 64-bit precision
values in its arithmetic operations.  Therefore the values are
computed in advance.

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-09-23 10:56:46 -05:00
Eric Sandeen c9f44c4adb 258: test timestamps before the epoch
ext2/3/4 was sign-extending times before the timestamp when read
from disk on 64-bit systems.  This was fixed by:

4d7bf11d649c72621ca31b8ea12b9c94af380e63
ext2/3/4: fix file date underflow on ext2 3 filesystems on 64 bit systems

Here's a generic regression test.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-09-23 10:56:44 -05:00
Gražvydas Ignotas 89781dcaa0 257: check getdents64() for duplicates
The test checks if no duplicate d_off values are returned and that
those values are seekable to the right inodes.

[Fixed typo "histoty" -> "history". -Alex]

Signed-off-by: Gražvydas Ignotas <notasas@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-09-23 10:56:43 -05:00
Lukas Czerner 2cede87d20 fstrim: Use strtoull instead of strtoul
When we are parsing input arguments we should really use stroull to get
unsigned long long numbers, since this is what we can specify on the
command line. With this fix it should parse long numbers on the 32 bit
architecture correctly.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-09-23 10:56:42 -05:00
David Sterba 314b221201 xfstests: setup and run non-generic mkfs for btrfs
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-08-25 07:06:10 +02:00
Christoph Hellwig 5659cc5b31 xfstests: fix loggen compile against recent xfsprogs headers
The XFS_BLI_CANCEL flag got rename to XFS_BLF_CANCEL, allow loggen compile
with both versions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2011-08-22 16:22:56 +02:00
Eric Sandeen 99102d6247 xfstests 062: Also accept "no such attribute" errors for invalid extended attributes
In older Linux kernels, requesting an extended attribute which cannot exist
failed with EPERM.  In version 3.0, this was changed to ENODATA so that
programs can distinguish between missing attributes and permission problems
independent of the file type.

For example, lgetxattr("file", "user.name", NULL, 0) will now return ENODATA if
no such attribute exists even if "file" is a symbolic link.

In test 062, to make it work on kernels before and after 3.0, accept either of
the two error results from getfattr.

Signed-off-by: Andreas Gruenbacher <agruen@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2011-08-19 09:57:12 -05:00
Stefan Behrens de164fbfb3 make t_immutable and 079 filesystem-agnostic
Changed the test 079 to be generic for all filesystems and to be executed
for all filesystems.  In src/t_immutable.c which is compiled for Linux
only, replace the old style XFS and ext2 specific code for setting the
append-only and immutable flags by generic code that makes use of the
ioctl(FS_IOC_SETFLAGS) and ioctl(FS_IOC_GETFLAGS) and remove the check for
the specific filesystem type.  FS_IOC_GETFLAGS/FS_IOC_SETFLAGS is always
used and placed in an '#ifdef FS_IOC_SETFLAGS' block in order to never fail
compilation.  Without support for FS_IOC_SETFLAGS, the test completes
with _notrun.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-08-03 14:00:15 +02:00
Stefan Behrens b2b36d0a4e make more tests generic
Use _scratch_mkfs / _scratch_mkfs_sized instead of _scratch_mkfs_xfs where
possible. Execute 015, 062, 083, 117, 120 and 192 for all filesystems, these
tests used to be XFS specific.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-08-03 14:00:15 +02:00
Christoph Hellwig 7d92016617 add nfs4 support
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jim Rees <rees@umich.edu>
2011-08-02 12:20:43 +02:00
Christoph Hellwig 4a53ac1856 add jfs support
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-08-02 12:19:47 +02:00
Christoph Hellwig 81ee4b6dc9 fix fsx build with newer xfs headers
The libxfs resync brought in a new round_up macro that conflicts with the
round_up function in fsx.  Rename the latter to allow building against the
new headers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2011-07-26 12:12:47 +02:00
Theodore Ts'o 40a566dc89 dmapi: fix build failure if libdm is provided via -ldm
The value of $(LIBDM) may be a linker specification -ldm, and not a
file.  So it's not OK to add this to the dependency, since make will
then complain that it doesn't know how to make the target -ldm.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-07-22 16:16:18 +02:00
Theodore Ts'o 0655d09fbf configure.in: declare a requirement for at least autoconf 2.50
On Debian/Ubuntu systems, if autoconf version 2.13 is installed,
autoconf will try to automatically figure out whether autoconf 2.13 or
something more modern is required (since the autoconf maintainers,
curses be upon them, didn't bother to maintain compatibility between
autoconf 2.13 and 2.50).  Unfortunately, the hueristics aren't
perfect, and although the configure.in file looks superficially like
it will be compatible with autoconf 2.13, it isn't.  You will end up
with a number of very subtle compilation failures if you use autoconf
2.13.

So declare a requirement for autoconf 2.50 using AC_PREREQ(2.50).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-07-22 16:16:18 +02:00
Jan Kara 7f4a2e30b2 xfstests: Improve test 219 to work with different filesystems
Different filesystems account different amount of metadata in quota.
Thus it is impractical to check for a particular amount of space
occupied by a file because there is no right value. Change the test
to verify whether the amount of space is between the expected amount
of space and the expected amount +5%.  The number of files is
checked exactly as previously.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-07-20 18:22:09 -05:00
Allison Henderson b55fb0807c xfstests: Add ENOSPC Hole Punch Test
This patch adds a new test 256 that tests that a hole can be punched
even when the disk is full.  Reserved blocks should be used to allow
a punch hole to proceed even when there is not enough blocks to
further fragment the file. To test this, the file system is
fragmented by punching holes in regular intervals and filling the
file system between punches. This will eventually force the file
system to use reserved blocks to proceed with the punch hole
operation.

The work in this patch is a continuation from a previous patch set
that has been partially accepted.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-07-20 18:22:07 -05:00
Allison Henderson 5c6a8cb5af xfstests: ENOSPC Punch Hole: Move su routines in 123 to common.rc
This patch moves the su routines in test 123 to common.rc so that
they can also be used in the new test 256

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-07-20 18:22:06 -05:00
Allison Henderson ced9681ea4 xfstests: Correct extent flag parsing for punch hole tests
The fiemap filters used in the punch hole tests parse the extent
flags in the fiemap to determine the extent type.  They are
currently parsing them as decimal values, but they should be parsing
hex values.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-07-20 18:22:05 -05:00
Dave Chinner c47d7a51ef xfstests: fix modulo-by-zero error in fsx
The recent fsx fixes has a logic error in the offset trimming code.
If a read is done when the file size is zero, then the logic error
causes a offset % 0 opertaion to occur. This causes fsx to get a
SIGFPE and die.

This was not discovered during my testing because I was using a
random seed that didn't trip this condition. Changing the seed to
that which test 091 uses (the default of 1) causes such an operation
to occur....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-07-20 08:43:41 +10:00
Dave Chinner 407191f702 xfstests: don't hard code the shell binary
Recent changes to debian unstable user space have caused the
xfstests build to break as certain shell functionality is being
assumed by libtool and friends.  The configure scripts test and
select the correct shell, but the input files ignore this and hard
code the shell to use and hence now break.

Fix this by using the shell that the configure scripts decide is the
right one to use.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
2011-07-17 11:46:56 +10:00
Alex Elder 0be5cdd635 xfstests: update test 250 and its golden output
Test 250 actually runs now that it has golden output defined.  The
output the test produces doesn't match the golden output, however.

The main reason seems to be a oversight in the test--the stderr
output of mkfs wasn't being ignored as it should be (likely for
debugging).  Remove the comment character so the stderr does get
ignored.

Doing this still leaves some other output, but since it's filtered
there's no reason to leave it out of the golden output.  So add
the expected result of filtering into the golden output file.

Finally, this test--unlike almost all of the others--specifies the
value of its "tmp" variable as a relative rather than absolute
path.  I'm sure that works in some places, but it produces errors
for me.  Follow the "tmp=/tmp/$$" convention used elsewhere.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-07-14 11:05:25 -05:00
Dave Chinner 5ad338be47 xfstests: fix fsx build failure.
Fix a brown paper bag "build and test the wrong tree" bug.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
2011-07-14 15:40:47 +10:00
Dave Chinner c00bad1c4c xfstests: add mapped write fsx operations to 091
The recent busted fsx updates caused fsx to execute fsx with direct
IO and mmapped reads and writes on an XFS filesystem. The result
uncovered a direct-IO write vs mmap read bug to do with EOF
sub-block zeroing on the direct IO write.

Hence whiel we do not recommend that pepole mix DIO with mmap on the
same file, we should at least have tests that exercise it as they
often show up other problems like this.


Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-07-14 15:27:27 +10:00
Dave Chinner 77c0620248 xfstests: fix brain-o in fallocate log dump
fsx segvs when dumping fallocate log entries. Fix magic string
array index parameters to be zero based rather than one based.

While touching log string related stuff, make the format consistent
with read and write operations so the log dump is easier to look at
with the human eye.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-07-14 15:27:16 +10:00
Dave Chinner 5843147ef1 xfstests: fsx fallocate support is b0rked
The recent fallocate/fpunch additions to fsx have not actually be
executing fallocate/fpunch operations. The logic to select what
operation to run is broken in such a way that fsx has been executing
mapped writes and truncates instead of fallocate and fpunch
operations.

Remove all the (b0rken) smarty-pants selection logic from the test()
function. Replace it with a clearly defined set of operations for
each mode and use understandable fallback logic when various
operation types have been disabled. Then use a simple switch
statement to execute each of the different operations, removing the
tortured nesting of if/else statements that only serve to obfuscate
the code.

As a result, fsx uses fallocate/fpunch appropriately during
operations and uses/disableѕ the operations as defined on the
command line correctly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-07-14 15:27:01 +10:00