* 'io_uring_restrictions' of https://github.com/stefano-garzarella/liburing:
Add test/register-restrictions.c test case
Add helper to enable rings
Add helper to register restrictions
io_uring.h: add register restrictions and enable ring defines
io_uring.h: use an enumeration for io_uring_register(2) opcodes
This patch adds io_uring_enable_rings() that can be used to
enable rings created with IORING_SETUP_R_DISABLED flag.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
The enumeration allows us to keep track of the last
io_uring_register(2) opcode available.
Behaviour and opcodes names don't change.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
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>
Guillem Jover correctly points out that this did used to be loff_t,
but was changed since it wasn't available everywhere.
Let's just use an int64_t, it's the same size and signed. Hopefully
this is it...
Signed-off-by: Jens Axboe <axboe@kernel.dk>
syscall.h is mising the forward declaration for struct io_uring_params, and sigset_t. Include the necessary
system header to make it independent.
Signed-off-by: Goro Fuji <g.psy.va@gmail.com>
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>
This reverts commit c415b39d67.
Glauber reports a regressions for his polled setup with this change.
As it's purely speculative, just revert it.
Reported-by: Glauber Costa <glauber.costa@datadoghq.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
The example currently assumes the file is at least 4*4096 bytes,
and errors when we get 0 reads on EOF. Fix this up.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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>
* 'master-debian' of https://github.com/metze-samba/liburing:
update debian/changelog
update debian/liburing1.symbols
debian/rules: pass down relativelibdir in order to get an absolute path