Omar Sandoval [Thu, 20 Dec 2018 22:12:03 +0000 (14:12 -0800)]
Add a test for the blk-mq direct issue corruption
This is based on a fio job from Jens with the following description:
This job file does:
One write/read verify set, using 256M of files, each 1M. The reader
part runs 16 times, and in two jobs, while the next write/read verify
set starts. This set is much larger, it's mainly meant to generate
write based IO with frequent fsyncs. The fsyncs are key, as they do
not queue on SATA. This means that the other reads (or writes) can
get a BUSY condition off direct issue, and with lots of other IO
going, stay around for a longer time before getting re-issued. This
increases the chances of a merge happening before they are re-issued.
I cannot reproduce this on bare metal, tried a lot of different
boxes. What does work reliably for me is a qemu setup, with 1 CPU,
and limited to 400M of RAM. The drive used for testing should be
the following:
-drive file=scsi.raw,media=disk,if=ide
created with: qemu-img create -f raw scsi.raw 10G
The machine type used with qemu was -machine q35,accel=kvm
Once booted, ensure that sda (if that's the drive above) is not using
an IO scheduler:
echo none > /sys/block/sda/queue/scheduler
Then just normally mkfs + mount the device, and run this job file in
the mount point.
Thanks to Lukáš Krejčí for describing how he reproduced it, the qemu
setup above is directly based on his description.
I.e., it only reproduces the bug under certain conditions, but it's
still valuable enough to have a fio verify test.
Omar Sandoval [Tue, 18 Dec 2018 20:15:56 +0000 (12:15 -0800)]
scsi/006: allow changing cache_type to fail
Some devices don't support all cache types. Allow setting the cache type
to fail with EINVAL. On success, make sure it was changed to the desired
value.
Bart Van Assche [Tue, 27 Nov 2018 20:57:11 +0000 (12:57 -0800)]
common/multipath-over-rdma: Retry unloading rdma_rxe if necessary
If any context, e.g. queued work, holds a reference on an rdma_rxe
device then it can happen that the first unload attempt fails. Try
several times to unload that kernel module if the first unload
attempt fails.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Thu, 1 Nov 2018 15:25:27 +0000 (08:25 -0700)]
src/sg/syzkaller1.c: Fix a 32-bit compiler warning
Avoid that clang reports the following warning when building in 32-bit mode:
sg/syzkaller1.c:405:34: error: implicit conversion from 'unsigned long long' to
'uintptr_t' (aka 'unsigned int') changes value from 18446744073709551615
to 4294967295 [-Werror,-Wconstant-conversion]
0x32ul, 0xfffffffffffffffful, 0x0ul, 0, 0, 0);
^~~~~~~~~~~~~~~~~~~~
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Mon, 29 Oct 2018 21:34:00 +0000 (14:34 -0700)]
src/discontiguous-io: Do not shadow variables
Avoid using variables in an inner scope with the same name as variables in
an outer scope. Enable the -Wshadow compiler flag for C and C++ source
files such that in the future the compiler will complain about shadowing.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Theodore Ts'o [Tue, 30 Oct 2018 14:36:49 +0000 (10:36 -0400)]
Fix build failure for discontiguous-io on 32-bit platforms
Avoid that building with a 32-bit compiler fails as follows:
discontiguous-io.cpp:294:34: error: no matching function for call to 'min(long unsigned int, size_t)'
std::min(4ul, len - i * 4));
^ Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[bvanassche: elaborated commit message] Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Jan Kara [Thu, 18 Oct 2018 10:31:47 +0000 (12:31 +0200)]
loop/006: Add test for oops during backing file verification
Add regression test for patch "block/loop: Use global lock for ioctl()
operation." where we can oops while traversing list of loop devices
backing newly created device.
Signed-off-by: Jan Kara <jack@suse.cz>
[Omar: rename to 006, change description] Signed-off-by: Omar Sandoval <osandov@fb.com>
Jens Axboe [Thu, 25 Oct 2018 20:49:04 +0000 (14:49 -0600)]
blktest: remove instances of null_blk queue_mode=1
This is no longer supported in recent kernels, get rid of any testing of
queue_mode=1. queue_mode=1 tested the legacy IO path, which is going
away completely. As such, there's no point in doing anymore testing with
it.
Add a series of tests for the NVMeOF drivers on top of the dm-mpath
driver. These tests are similar to the tests under tests/srp. Both
tests use the dm-mpath driver for multipath and the loopback
functionality of the rdma_rxe driver. The only difference is that the
nvmeof-mp tests use the NVMeOF initiator and target drivers instead
of the SRP initiator and target drivers.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
tests/srp: Remove /etc/multipath.conf after a test has finished
Instead of removing /etc/multipath.conf before a test starts, remove it
after a test has finished. This change is needed to let the nvmeof-mp
tests run after the srp tests have been run.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Linux kernel commit ca4b2a011948 ("null_blk: add zone support") broke
null_blk queue_mode=0. None of the existing tests use bio mode, so add a
test which does a very basic test of all modes.
Omar Sandoval [Fri, 10 Aug 2018 18:07:59 +0000 (11:07 -0700)]
Delete nvme/001
Johannes pointed out that the format of this tracepoint is going to
change in 4.19, which will make this test fail. Now that we have a slew
of real NVMe tests, we can do without this one. We can always add it
back if we decide it's useful later.
Bart Van Assche [Tue, 19 Jun 2018 20:39:23 +0000 (13:39 -0700)]
Add tests for the SRP initiator and target drivers
This patch adds the following tests:
001: Create and remove LUNs
002: File I/O on top of multipath concurrently with logout and login (mq)
003: File I/O on top of multipath concurrently with logout and login (sq)
004: File I/O on top of multipath concurrently with logout and login (sq-on-mq)
005: Direct I/O with large transfer sizes, cmd_sg_entries=255 and bs=4M
006: Direct I/O with large transfer sizes, cmd_sg_entries=255 and bs=8M
007: Direct I/O with large transfer sizes, cmd_sg_entries=1 and bs=4M
008: Direct I/O with large transfer sizes, cmd_sg_entries=1 and bs=8M
009: Buffered I/O with large transfer sizes, cmd_sg_entries=255 and bs=4M
010: Buffered I/O with large transfer sizes, cmd_sg_entries=255 and bs=8M
011: Block I/O on top of multipath concurrently with logout and login
012: dm-mpath on top of multiple I/O schedulers
013: Direct I/O using a discontiguous buffer
Other changes in this patch are:
- Add function _have_kernel_option to common/rc.
- Add file tests/srp/rc with shell functions that are used by multiple SRP
tests.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Add c-mode settings for the files in the src directory. Additionally,
make indent-tabs-mode global such that it also applies to the
.dir-locals.el file itself.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
block/008: fix race between CPU offline and fio startup
If fio is still setting up when we start hotplugging CPUs, fio can fail
with "clock setaffinity failed: Invalid argument". That comes from
calling sched_setaffinity() on an offline CPU. We can make this much
less likely to happen by sleeping before we start hotplugging.
Hannes Reinecke [Wed, 9 Aug 2017 10:50:06 +0000 (12:50 +0200)]
scsi: regression test for SCSI device blacklisting
SCSI device blacklisting seems to be a tricky subject, with lots of
potential for messing up the selection algorithm. This adds a test for
catching regressions here.
Signed-off-by: Hannes Reinecke <hare@suse.com>
[Omar: updated to use improved scsi_debug helpers] Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Tue, 26 Jun 2018 18:27:11 +0000 (11:27 -0700)]
Make group/rc and common/rc sources explicit and reenable SC2034
SC2034 (unused variable) is a useful warning, but we disabled it because
we set a bunch of global variables as test metadata. However, this is
easy to work around: as Bart demonstrated, an echo "$VAR" > /dev/null
does the trick.
However, we don't want to copy-and-paste this everywhere, so we need to
source something everywhere. Bart's idea was to put this in
common/shellcheck and source that everywhere. Sourcing a file just to
appease the linter is silly, though, so instead, this adds explicit
sources of tests/*/rc to each test, which in turn sources common/rc,
which in turn sources common/shellcheck.
Johannes Thumshirn [Tue, 12 Jun 2018 09:57:06 +0000 (11:57 +0200)]
check: add command line switch to test device drivers only
Sometimes it's useful to only run tests which exercise a device special
driver to verify a patch for the driver doesn't introduce a regression.
Running the whole test-suite is just a waste of time in this case, so
provide a way to only run tests which have a test_device() function set
and not a test() function.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: fix argument parsing, move check to found_test(), add documentation] Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Mon, 11 Jun 2018 20:34:40 +0000 (13:34 -0700)]
block/008: fix shellcheck warnings
tests/block/008:68:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
tests/block/008:74:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]