'th doesn't really work for 1/2/3 timeouts, just use # to make it
clear we're dealing with the timeout number.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
30 seconds is just a bit too short if the tests are run with
KASAN and PROVE_LOCKING enabled, make it 60 seconds instead.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Enable -Wextra and disable the unused parameter and different signedness
in comparison warnings.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
After copying len(str) bytes of a string, the copy won't necessary have
\0 terminator, that makes test_pipe_io_fixed() to fail. Use memcmp().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Lifted this from blktests, basically it just checks for known patterns
of kernel complaints. If we trigger one while running a test, we fail
the test case.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We submit both the read and write at the same time, there's no guarantee
the write is even started by the time the read is issued. Play it safe
and wait for the write before starting the read.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This new test checks if the mechanism to enable/disable notifications
through eventfd when a request is completed works correctly.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add it to .gitignore as well. This makes it easier to have a local
configuration that isn't overwritten by resetting the git tree, or
pulling changes.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Split and test functionality separately, better cover registered files
cases, and validate file\pipe actual data.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Depending on timing, we can get -EBADF from the waiting on a
completion. This is fine, as we've closed the ring itself, so we
cannot rely the completion coming in, it'll depend completely on
the timing of events.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Just call it and check that it doesn't hang and returns success.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We expect -EALREADY since an async worker was previously holding this
request, but for kernels with FASTPOLL (5.7+), we can successfully
cancel from the timeout. Allow -ETIME as well for the return value of
the linked timeout.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Guillem reports that some new 32-bit architectures like armel and armhf
don't have mmap, just mmap2. Just use mmap() and let libc deal with
it, there's no reason why we need to call the specific mmap() system
call.
Reported-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We just check for -EFAULT, but -ECANCELED is also OK and will happen
on later kernels since we check earlier there for prep and defer.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Test both vectored and non-vectored reads, and also add two test
cases for vectored and non-vectored short reads.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
On certain architectures, like ppc64, __u64 is a typedef of unsigned long
rather than unsigned long long, which causes warnings when compiling tests
that use the %llu printf specifier.
If __SANE_USERSPACE_TYPES__ is defined before including <linux/types.h>,
__u64 will instead be a typedef of unsigned long long.
If we don't have PROVIDE_BUFFERS, then ensure we free the ring, and
(more importantly) up the mutex so we don't hang.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
The previous include is not enough, some older distros don't have
the memfd_create() in libc. Just get rid of it and open a regular
file instead.
Signed-off-by: Jens Axboe <axboe@kernel.dk>