Commit Graph

47 Commits

Author SHA1 Message Date
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 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
Dave Chinner c18bf42de9 xfstests: fix fsx fpunch test to actually test for fpunch
The operation flags parameter to fallocate is the second parameter,
not the last. Hence the fpunch test is actually testing for falloc
support, not fpunch. Somebody needs a brown paper bag.

Also, add a ftruncate call whenthe fpunch succeeds just in case the
file was not already zero sized. Failing to ensure we start with a
zero length file can cause read ops to fail size checks if they
occur before the file is written to be the main test loop.

While there, observe the quiet flag the same as the falloc test
does and have them both emit the warning at the same error level.

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 14:07:58 +10:00
Akshay Lal dbbad331d3 Fix the ltp Makefile to allow for installation of all non-c (scripts) files
Current the Makefile only builds the .c files and installs
them in the $INSTALL path. However, the ltp directory contains a shell script,
which doen't get copied over (installed) when a "make install"is invoked.

This behaviour causes test 080 to fail since it requires rwtest.sh to be
present in the ltp/ directory.

Tested: Updated the Makefile and ran a static build script & test
080.

Signed-off-by: Akshay Lal <akshaylal@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-07-13 14:07:41 +02:00
Allison Henderson abccd8eb54 add hole punching support to fsx
This patch adds punch hole tests to the fsx stress test.

Signed-off-by: Allison Henderson <achender@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-06-17 14:14:57 +02:00
Boris Ranto 630421f6d4 xfstests: fsx: do not print fallocate support warning in quiet mode
ltp/fsx.c tests whether the filesystem it is run on supports fallocate.
If it is not supported the fsx will print warning to stderr. This leads
to fails of tests 075, 112, 127 for the filesystems that do not support
fallocate. The tests use ltp/fsx but do not filter out stderr. Since 
ltp/fsx.c can work without fallocate support I propose to move this
message to stdout unless quiet output is not requested. Previous patch
printed the message even if -q flag was used. This patch honours the flag.

This simple patch fixes the issue for me, tested on all the mentioned tests:

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2011-05-11 12:02:24 -05:00
Alex Elder a241a16214 xfstests: some refinements on "make depend"
Make it so "make depend" is a generic target, like "make clean".

Each Makefile has a "depend" target that indicates whether making
dependencies means creating ".dep" or creating ".ltdep" (or, I
suppose, both, though none do that right now).  Both files get
created even if there are no CFILES to scan (to ensure the target
up-to-date).  The "default" target now depends on "depend" (there is
no "ltdepend" any more).

Remove the "depend" and "ltdepend" definitions from the "buildrules"
file; only the actual generated files (".dep" and ".ltdep") remain
as generic targets.  The "depend' target is still defined as phony.

Do a shell trick when expanding the value of CFILES, to avoid a
problem that occurs if it is created by "make" by concatentating two
empty strings.  The problem was that in that case CFILES will
contain a space, and that wasn't getting treated as empty as
desired.

Make the rule for tool/lib dependencies more generic, to reflect the
general desire that "lib" subdirectories need to be built before
things in the "tool" subdirectories.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-03-11 06:45:19 -06:00
Eric Sandeen 195df5adfb Add fallocate calls to fsx
Add random runtime fallocate calls to fsx (vs. the existing
preallocate file at start of run).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-03-09 10:35:19 -06:00
Alex Elder 90eed13c43 xfstests: fix some warnings
Fix a couple of build warnings.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-13 09:59:49 -06:00
Dave Chinner 76f1b870d9 xfstests: Automatic build dependency calculations
Currently the xfstest builds do not have any automatic dependency
calculations. It relies on a separate make depend run to build or
update dependency information. It also relies on an external
makedepend binary. If that binary does not exist, the dependencies
do not get calculated.

To remove the dependency on makedepend, gcc can be used instead as
it has a command to generate dependency information. This patch
changes the dependency rule building to use gcc.

In case anyone uses an old (several years) gcc compiler or a
compiler that doesn't support gcc compatible dependency generation,
a new configure check is added to turn off dependency checking so
builds can still be done.

To use the dependencies automatically, we need to use a special
include makefile directive to include the build dependencies into
the current makefile.  Essentially once the dependencies are
calculated, they can be included into the makefile and make will
recalculate the build dependencies automatically based on that
information.

Hence we get a build that automatically calculates and keeps
dependencies up to date without dependence on any external tools.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-01-26 14:22:35 +11:00
Dave Chinner 2093988d6d xfstests: fix printf format warnings in aio-stress.c
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-01-21 08:54:01 +11:00
Dave Chinner e7cfc10a44 xfstests: Don't use tempnam in growfiles.c
tempnam() generates a compiler warning as a dangerous function.
This code doesn't care about security issues with tempnam, so
remove it and just manually build the filenames without the
randomness of tempnam.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-01-21 08:53:53 +11:00
Dave Chinner b1da830791 xfstests: fix bulkstat related compile warnings.
Use correct types for bulkstat structure to avoid pointer warnings.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-01-21 08:53:44 +11:00
Dave Chinner 615144496f xfstests: fix compile warning in doio.c
Use of sigblock is deprecated. Use sigprocmask instead.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-01-21 08:53:27 +11:00
Dave Chinner 387165ab40 xfstests: Use common rules to build binaries
Remove explicit target-per-file rules in the subdirectories being
built and replace them with target based rules using the buildrules
hooks for doing this.  This results in the makefiles being simpler,
smaller and more consistent. It does mean that all binaries are
linked against the common set of libraries but this does not cause
any harm.

This patch does not address the dmapi subdirectory of the xfstests
build system.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-01-20 10:26:10 +11:00
Eric Sandeen 2341811efd update aio-stress.c, with copyright information intact
Pulled from:
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/io/ltp-aiodio/aio-stress.c
revision 1.8

There are a couple new options, but the main motivator is to
get the license text intact again.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2009-06-05 14:12:27 -05:00
Eric Sandeen 84567e4977 Drop the xfs-specific MAXNAMELEN in favor of the Posix NAME_MAX
This makes it easier to lose libxfs.h later.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2009-05-28 11:35:56 -05:00
Theodore Ts'o 6bb39a9df4 fsx: Add check for mmap last-page zero fill
Check to make sure the VM system provided 0's beyond the true end of
the file mapping (as required by mmap def in 1996 posix 1003.1)

This check was taken from the FreeBSD version of fsx.c.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
2009-05-13 15:52:42 -05:00
Theodore Ts'o 969f36df3e fsx: Replace use of bcmp() with memcmp()
The bcmp() function comes from BSD 4.3, and was deprecated in
POSIX.1-2001.  It was removed entirely in POSIX.1-2008.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
2009-05-13 15:52:23 -05:00
Theodore Ts'o 59040620b4 fsx: Replace use of bzero() with memset()
The bzero() function comes from BSD 4.3, and was deprecated in
POSIX.1-2001.  It was removed entirely in POSIX.1-2008.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
2009-05-13 13:31:46 -05:00
Theodore Ts'o 3dc6054e2a fsx: Use %ll instead of %q in printf format statements
The ISO C approved way of printing long long variables is %ll.  The %q
length modifier was used in BSD 4.4 and Linux libc5, and its use is
discouraged as non-standards compliant.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
2009-05-13 13:31:46 -05:00
Theodore Ts'o c9c238d22b fsx: Use SEEK_END instead of the BSD'ish L_XTND
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
2009-05-13 13:31:47 -05:00
Felix Blyakher d0f0d2f428 xfstests: fix async io error handling in fsx
The result of async io returned in the event.res in addition
to the number of bytes read/written provides negated error
number. The broken libaio defines event.res as unsigned
while the same structure in the kernel defines it as signed.
The kernel indeed treats it as signed, and returns the
negated error number. Till libaio is fixed we provide
the signed long temp var.
Also set errno for each error condition in aio_rw, as the
caller is not aio aware and expects ret(-1)+errno by the
traditional libc convention.

Signed-off-by: Felix Blyakher <felixb@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2009-04-13 16:46:00 -05:00
Eric Sandeen 8c5325e126 Create xfstests install target.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2009-01-02 22:28:37 -06:00