This is fixed by upstream commit:
commit 68faa4727c0e2d7d255d9b97e754f2cda748f141
Author: Jens Axboe <axboe@kernel.dk>
Date: Tue Aug 25 12:27:50 2020 -0600
io_uring: don't use poll handler if file can't be nonblocking read/written
We're testing whether we first get some data, then a zero return on the
next one when it's closed. The buggy behavior was to arm a poll handler,
which isn't notified when the pipe is closed.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
If the ring is configured to operate in poll mode we need to always
enter the kernel to fetch new events. This behavior was introduced
in bf3aeb3dbb but recently broken.
Break me once, shame on you. Break me twice, shame on me:
- Add a unit test.
The unit test submits sqes manually through the system call, which
guarantees that IORING_ENTER_GETEVENTS will not be present in the flag
set during the initial submission.
The only way we can ever fetch new I/O events is if io_uring_submit
indeed will enter the ring despite not having new sqes to submit.
This test passes with 8e8cb865cd but fails before it due to the
aforementioned regression.
Signed-off-by: Glauber Costa <glauber@datadoghq.com>
We currently rely on this test being killed by runtests.sh, and
the test expects this and exits nicely when that happens. But let's
give it a finite runtime in general, so that running it independently
will have it exit nicely on its own as well.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This is the generated syzkaller reproducer. Should be fixed by this
mainline commit:
commit d4e7cd36a90e38e0276d6ce0c20f5ccef17ec38c (HEAD -> io_uring-5.9, origin/io_uring-5.9)
Author: Jens Axboe <axboe@kernel.dk>
Date: Sat Aug 15 11:44:50 2020 -0700
io_uring: sanitize double poll handling
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This should be fixed by the kernel commit:
commit f254ac04c8744cf7bfed012717eac34eacc65dfb
Author: Jens Axboe <axboe@kernel.dk>
Date: Wed Aug 12 17:33:30 2020 -0600
io_uring: enable lookup of links holding inflight files
Signed-off-by: Jens Axboe <axboe@kernel.dk>
errno will be ENOSYS, not EOPNOTSUPP if the syscall is not there. This
also matches what errno is set to in do_statx if __NR_statx is not
defined.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Probably don't need this, but it's right before release and I'd hate
for a test to cause compilation failure.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Use __NR_statx in do_statx and unconditionally use it to check the
result on all architectures, not just x86_64. This relies on the
fact that __NR_statx should be defined if struct statx and STATX_ALL are
available as well.
Don't fail the test if the statx syscall returns EOPNOTSUPP though.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We only care about if we get less than 8, it's perfectly valid to
get the full 12. In fact, once we modify peek to ensure we flush
kernel side overflows, we will get more.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We only care about if we get less than 8, it's perfectly valid to
get the full 16. In fact, once we modify peek to ensure we flush
kernel side overflows, we will get more.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Since the liburing header files support C++ compilers, add a C++ unit test.
This helps to verify C++ compatibility of the liburing header files.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
'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>