When buffered writes are used then two things change:
1 - signals will propogate to the submit() call (as they would be
effectively ignored when going async)
2 - CQE ordering will change
Fix the read-write for both of these cases by ignoring the signal and
handling CQE ordering.
Before the 6.0 kernel, any buffered write would go through io-wq. This
meant any signal delivered would be to io-wq, which ignores any non-fatal
signals.
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220815170914.3094167-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
timing issues might cause out of order completes on older kernels,
especially regarding selecting a buffer before queueing up IO (as it can
complete with ENOBUFS being queued).
Theres no reason to test ENOBUFS for this problem, so remove those checks.
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220704160614.1033371-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Silences the following:
* Error due to no definition for `mode_t` in `liburing.h`
* Warning due to use of non-portable `#include <sys/poll.h>` and `#include <sys/signal.h>`
* Warning due to incorrect `printf` format specifier in `test/io_uring_register.c`
* Error due to missing declaration for `strcpy` in `test/sendmsg_fs_cve.c`
* Error due to missing declaration for `strerror` in `test/shutdown.c`
Signed-off-by: Mahdi Rakhshandehroo <mahdi.rakhshandehroo@gmail.com>
A previous commit changed the file size from 128M to 256M, and this
caused the EFBIG test case to be buggy. Update it so it works again.
Fixes: ee61b6e290 ("test/read-write: work on 4kb blocksize devices")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
For some tests, we chop the iovec in two. Since the iovec is 4k in
size, this fails on devices that are actually using 4k block sizes.
Just bump the iovec size to 8k, then it'll work fine on 4k devices.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Use t_create_ring() in read-write.c and iopoll.c, the function will do
all the privilege checks.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
As brought up in an issue, this makes it confusing as to what could
potentially be liburing functions. Make it clear that these are test
helpers, hence use the t_ prefix for them.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
add io_uring_create_buffers() helper, and replace
create_buffers() with io_uring_create_buffers() helper.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
cleanup: add io_uring_create_file() helper,
and replace create_file() with io_uring_calloc() in tests.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
add io_uring_posix_memalign helper, and replace
all posix_memalign() with io_uring_posix_memalign()
in all tests.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
As axboe said, Right now a lot of basic stuff is duplicated,
and it makes the tests bigger than they should be.
Here, we try to add helpers.h which will contains various
utilities that tests could use, then that'd help make tests simpler.
In this patch, we just add one helper io_uring_malloc(), which
will call assert() if allocating memory fails.
We will add more helpers in subsequent patches
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Basic testing for IORING_OP_REMOVE_BUFFERS. test_rem_buf(IOSQE_ASYNC)
should check that it's doing locking right when punted async.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Broaden registered buffers coverage with registering buffers with
non-aligned random offsets and sizes. That in particular test how we're
setting and advancing in-kernel bvecs.
Pass exp_len==-1 for that, so it compares against iov_len with which it
was initialised. Also, direct IO requires alignment, so do it in
buffered mode.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Replace obscure v1-v6 with more readable flag names.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
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>
This is a start, still some to go. The goal here is to ensure that we
use stderr consistently for errors, and include the error value as well.
Right now folks copy/paste test cases (which they should), but that
also means they should be doing the right thing so we don't keep adding
test cases that just use stdout for errors, or don't include the error
value.
Signed-off-by: Jens Axboe <axboe@kernel.dk>