Commit Graph

55 Commits

Author SHA1 Message Date
Zorro Lang 544624ac14 fsstress: add splice support
Support the splice syscall in fsstress.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-01-27 11:56:38 +08:00
Darrick J. Wong 50fa944e89 fsstress: add copy_file_range support
Support the copy_file_range syscall in fsstress.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-09 22:55:47 +08:00
Darrick J. Wong 39faacd274 fsstress: check system call return values
Check the return values of various system calls and blow up if something
went wrong.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-By: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-09 22:55:21 +08:00
Darrick J. Wong b7b480a0ab fsstress: fix compiler warnings
Fix all the gcc warnings in fsstress, and resize buffers to avoid
overflows.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-By: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-12-09 22:55:18 +08:00
Lu Fengqi d61c29d32f fsstress: remove include <attr/xattr.h>
Since commit de6d86177f ("QA test updates - fixes for pquota,
extsize, fsstress, and ensure mount options passed through to
test_dev. Merge of master-melb:xfs-cmds:24763a by kenmcd.") remove
llistxattr from fsstress, xattr.h is useless.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-07-01 20:35:27 +08:00
Dave Chinner 6ab53c6c68 ltp/: spdx license conversion
Mostly scripted like all the others, manually added tags to
Makefile. aio-stress.c was manually touched up before scripted
conversions.

Notes for future reference:
- fsx.c license is ambiguous. Not tagged in any way.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
2018-06-22 10:38:11 +08:00
Darrick J. Wong 5e65145233 fsstress: avoid infinite loops in clonerange_f
Evidently ceph will report a 4M blocksize, which trips clonerange_f's
clumsy attempt to avoid reflinking an extent on top of itself.  The
original code assumed that "pick a random destination up to 1MB past the
end of the file" would suffice, but that clearly won't with a 4M
blocksize.  Instead, we'll change it to 1024*blksize.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Tested-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2018-02-24 12:04:55 +08:00
Rostislav Skudnov 836ed899ae fstests: Replace all __[u]intNN_t types with standard [u]intNN_t
Integer types such as __uint32_t are non-standard and not supported
by some C libraries such as musl. This commit replaces them with
standard types such as uint32_t and includes stdint.h header where
necessary.

The following command was used to do the changing of types:
sed -r -i 's/__(u?int[0-9]{2}_t)/\1/g' src/*.c ltp/*.c

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2018-01-24 11:49:50 +08:00
Rostislav Skudnov 8c0fc542ed fsstress: Include stddef.h for ptrdiff_t
In musl C library headers ptrdiff_t is only defined in stddef.h.

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2018-01-24 11:48:51 +08:00
Darrick J. Wong e76e13ce8c fsstress: implement the clonerange/deduperange ioctls
Mix it up a bit by reflinking and deduping data blocks when
possible.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2018-01-02 19:25:01 +08:00
Ari Sundholm db71085194 fsstress: getcwd() return value fixes
Add a check for the return value of getcwd(). Fix another check
which mistakenly checks if the return value is less than zero
instead of checking whether the return value is NULL.

Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-12-24 21:30:58 +08:00
Ari Sundholm 6db67b7252 fsstress: Eliminate valgrind noise
This patch plugs what we think are the remaining sources of valgrind
noise we found when running fsstress under valgrind.  The noise is
caused by memory being left unfreed before process termination.

Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-12-24 21:30:58 +08:00
Rostislav Skudnov ebd721deac fsstress: Fix wrong size argument to getcwd()
Fixes the following ASAN failure:

==11670==WARNING: AddressSanitizer failed to allocate 0xffffffffffffffff bytes
==11670==AddressSanitizer's allocator is terminating the process instead of returning 0

...

    #5 0x4bb230 in __interceptor_malloc /home/vak-local/3.9.1/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:65:10
    #6 0x7f97e6491405 in getcwd /build/glibc-6V9RKT/glibc-2.19/io/../sysdeps/unix/sysv/linux/getcwd.c:68
    #7 0x454691 in getcwd /home/vak-local/3.9.1/release/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:2822:15
    #8 0x4f765d in doproc /.../ltp/fsstress.c:933:12
    #9 0x4f5f54 in main /.../ltp/fsstress.c:581:5

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-10-06 20:45:04 +08:00
Zorro Lang b669b303d0 fsstress: fallback to block size for min dio size
XFS_IOC_DIOINFO is only used for XFS, but fsstress use it to get
DIO aligned size. If XFS_IOC_DIOINFO returns error, then stop
doing any DIO related test (dread/dwrite/aread/awrite etc). That
means we never do DIO related test on other filesystems by fsstress.

The real minimal dio size is really not so important for DIO test
in fsstress. The multiple of real min dio size is fine too. I think
the stat.st_blksize get from stat() system call can be used to be
a fake minimal dio size, if XFS_IOC_DIOINFO fails (not supported).

Note that the equation about d_maxiosz is copied from kernel
XFS_IOC_DIOINFO ioctl source code:

  case XFS_IOC_DIOINFO: {
    ...

    da.d_mem =  da.d_miniosz = target->bt_logical_sectorsize;
    da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1);

    ...
  }

[eguan: update commit log add d_maxiosz reference]

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-09-03 12:20:00 +08:00
Zorro Lang 3fcc2c75bf fsstress: add AIO read/write and fsync test
We found some bugs by aio read/write test, but there's no such
operations in fsstress. So add AIO test into fsstress to increase
AIO stress test.

Due to most kernels don't support aio fsync, so set its test
frequency to zero as default.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-07-28 18:53:50 +08:00
Zorro Lang 80499d8f5f fsstress: new writev and readv operations test
We found some bugs by writev operations recently, writev can cover
different test than normal write operation, so add writev and readv
operations into fsstress.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-07-28 18:53:50 +08:00
Zorro Lang 5a1b35a743 fsstress: cleanup flist with test directory together
The "-c" option of fsstress will clean up the test directory after
each run. But it only does "rm -rf $dir". If run fsstress likes:

  fsstress -d $test_dir -n 1000 -p 10 -l 0 -c

fsstress will remove all test directories at the end of each run,
but the flist still save those *deleted* entries. It'll cause
more and more useless ENOENT failures. So we need to release all
entries in flist too.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-05-19 15:06:23 +08:00
Zorro Lang 4e7d1c5e09 fsstress: add mwrite/mread into test operation list
mmap is a popular and basic operation, most of softwares use it to
access files. More and more customers report bugs related with
mmap/munmap and other stress conditions.

So add mmap read/write test into fsstress to increase mmap related
stress to reproduce or find more bugs easily.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-03-29 15:07:25 +08:00
Jeffrey Bastian ca7c8bcbe8 build: avoid struct fsxattr redefinition
Linux kernel v4.5 defines 'struct fsxattr' in linux/fs.h [0] but
it's still defined in xfs/linux.h as a backup [1].  If the files are
included in the wrong order, the compiler will complain with a
redefinition error.  This patch moves linux/fs.h (and linux/magic.h)
before the xfs headers for the t_immutable.c and fsstress.c tests.

[0] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=334e580a6f97e
[1] http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=blob;f=include/linux.h;h=cc0f70ceed72#l183

Signed-off-by: Jeffrey Bastian <jbastian@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:28:46 +08:00
Theodore Ts'o ad75f28690 fsstress: add the -c option
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>
2015-08-04 14:10:44 +10:00
Theodore Ts'o cf67ba1e32 fsstress: add the [-l loops] option
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>
2015-08-04 14:10:44 +10:00
Namjae Jeon 6e5194daba fsstress: Add fallocate insert range operation
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>
2015-02-25 15:34:48 +11:00
Namjae Jeon 995a459e7a fsstress: fix incorrect if condition check for collapse range mode
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>
2014-05-13 15:26:59 +10:00
Namjae Jeon d37388c21b fsstress: remove duplicate COLLAPSE_RANGE flags
Remove duplicate COLLAPSE_RANGE flags

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-04-22 10:46:12 +10:00
Lukas Czerner f98d930f3f fsstress: Add fallocate collapse range operation
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>
2014-04-04 17:23:14 +11:00