I see the following with gcc 4.8.5 [-Wunprototyped-calls]:
warning: call to function 'cleanup' without a real prototype
Fix this by moving the function definition up, and dropping the
prototype.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Compilation failed on RHEL6.7GA because stdbool.h is not included in
xfs/platform_defs-x86_64.h or xfs/linux.h on RHEL6.7GA, so fix it.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Create a $name.fsxops file next to $test.fsxlog. When a test fails,
dump the operations in the log into that file in a simple, parseable
format like:
fallocate 0x2e0f2 0xf04a 0x0 keep_size
truncate 0x0 0x11e00 0x0 *
write 0x73400 0x6c00 0x11e00
skip punch_hole 0x71539913 0xdf76 0x7a000 close_open
mapread 0x56000 0x16d08 0x7a000
Here, each operation is on a separate line. When the first word is
"skip", the operation will be skipped. The next parameters are offset,
length, and the current file size, followed by optional flags like
keep_size and clode_open. A trailing asterisk indicates that the
operation overlaps with the operation that has failed.
Add a --replay-ops option that allows to replay the operations recorded
in such a $name.fsxops file. (The log can be modified to easily narrow
down which operations are causing the failure.)
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Add FL_SKIPPED, FL_CLOSE_OPEN, and FL_KEEP_SIZE flags to the log
entries. Use FL_SKIPPED to indicate that an operation was skipped. Use
FL_CLOSE_OPEN to encode when an operation is followed by a close/open
cycle. Use FL_KEEP_SIZE to indicate when the OP_ZERO_RANGE and
OP_FALLOCATE operations should keep the file size unchanged and put the
current file size into args[2] so that we can tell which operation was
actually called from the log.
After that, arg2 of log4 is always either unused or the current file size, so
remove it and unconditionally remember the current file size.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Generate all test parameters in test(), including keep_size.
The code is slightly more complicated than it could be to produce the
same sequence of operations for the same random seed.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Some hex numbers are prefixed with "0x" and right-aligned with spaces,
leading to output like "0x beef". Make that "0x0beef" instead.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Move the run_fsx shell function into common/rc. Fix it to avoid
duplicate output on errors. Write the actual fsx parameters used into
$seqres.full instead of the BSIZE and PSIZE placeholders.
Include the symbolic fallocate mode in fsx error messages instead of the
numeric value. Use fprintf(stderr, ...) instead of warn() when
including strerror(errno) doesn't make sense.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
After upgrading userspace on test machines to xfsprogs-4.2.0-rc1,
lots of build warnings and failures are exposed from implicit
includes that no longer exist. Hence these need fixing to allow
fstests to build correctly.
gcc also seems to have grown new stupidities around uninitialised
variables, so fix them while touching the same files.
Signed-off-by: Dave Chinner <david@fromorbit.com>
This option causes fsstress to delete the test directory between each
run. This is the opposite from the ltp version of fsstress, which
deletes the test directory by default, and the -c option caused ltp's
fsstress _not_ to delete the test directory.
It can be useful to be able to have the same test behavior as ltp
version, and although reversing the sense of the option is
unfortunate, it also reserves the -c option, which makes it a bit
easier if we want to eventually have one version which is a superset
of the xfstest and ltp version of fsstress.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This feature is in the ltp version of fsstress; port it into
xfstests.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit adds insert operation support for fsstress, which is
meant to exercise fallocate FALLOC_FL_INSERT_RANGE support.
[dchinner: turn off this op for xfs/068, which expects an exact
outcome from the fsstress execution. ]
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The NFS implementation of fallocate() does not support passing the
KEEP_SIZE flag by itself, causing tests to randomly fail.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
1000 operations is not nearly enough to debug complex data integrity
issues, so increase the log buffer by an order of magnitude.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
There is if condition to be block aligned for off and len of Collapse range.
But off and len for all fallocate opearion can be aligned by incorrect
if condition check.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit adds collapse operation support for fsstress, which is
meant to exercise fallocate FALLOC_FL_COLLAPSE_RANGE support.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit adds fzero operation support for fsstress, which is meant to
exercise fallocate FALLOC_FL_ZERO_RANGE support.
Also reorganise the common fallocate code into a single do_fallocate()
function and use flags use the right mode.
Also in order to make more obvious which fallocate mode fsstress is
testing translate fallocate flags into human readable strings.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Move the inclusion of falloc.h with all it's possible defines for the
fallocate mode into global.h header file so we do not have to include
and define it manually in every tool using fallocate.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
- It would be useful to have verifiable logging mode which will contain
only deterministic information which allow to compare two logs files
generated from two runs with same seed.
- Also add missed help for '-o logfile' option
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>