summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-10setup: provide helpers to inquire about necessary mlock sizesmlock-sizeJens Axboe
5.12 and up will not require rlimit memlock allocations, but older ones do. It can be hard for applications to know how much they need without trial and error, so provide a set of helpers for them to query it instead. It's a bit ugly as it's mostly duplication of what the kernel does, but as that code is now static and won't be updated as no new kernels require memlock, that's probably not a huge issue. Fixes: https://github.com/axboe/liburing/issues/246 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-04-06test/poll-mshot-update: test live updates of triggering requestsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-04-04tests: test CQE ordering on early submission failPavel Begunkov
Check that CQEs of a link comes in the order of submission, even when a link fails early during submission initial prep. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-04-03test/rw_merge_test: code cleanupsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-31Merge branch 'io_merge_testcase' of https://github.com/dmonakhov/liburingJens Axboe
* 'io_merge_testcase' of https://github.com/dmonakhov/liburing: add test case for 5.4 io merge regression logic
2021-03-31test: get rid of x86_64'isms in the test codeJens Axboe
Most/all of these are from syzbot. Turn them into regular system calls, and just let liburing sort out the non-x86 ones. Fixes: https://github.com/axboe/liburing/issues/322 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-31test/ring-leak: get rid of warning on unchecked readJens Axboe
ring-leak.c: In function ‘test_iowq_request_cancel’: ring-leak.c:131:2: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 131 | read(fds[0], buffer, 10); | ^~~~~~~~~~~~~~~~~~~~~~~~ We really don't care, but the warning is annoying. So get rid of it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-31test/pipe-reuse: ignore short readJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-29test/connect: randomize connect portJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-29test/socket-rw*: don't fatally error on failure to bindJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-26tests: more cancellation testsPavel Begunkov
Add a test checking we don't cancel extra on exit() cancellation. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-26examples/io_uring-cp: wait for pending writes before exit copy loopJens Axboe
We could be ending the loop with all reads done, but with pending writes that we haven't waited for yet. Ensure that we do so. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-19add test case for 5.4 io merge regression logicDmitry Monakhov
Prior to switching io-wq we try to merge adjacent read/write requests. But because of bug in merge logic io may stuck
2021-03-18tests: test that ring exit cancels io-wqPavel Begunkov
Test that io_uring_queue_exit() does proper cancellation of io-wq. Note that there are worse cases with multiple tasks that can hang in the kernel due to failing to do io-wq cancellations properly. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/2eee395a2cf1bea49036aa82b056ff7bfd2cda14.1615566409.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-18tests: add more IORING_OP_ASYNC_CANCEL testsPavel Begunkov
test_dont_cancel_another_ring() makes sure that it doesn't cancel requests of an unrelated ring, that may happen because of io-wq sharing. test_cancel_req_across_fork() verifies that IORING_OP_ASYNC_CANCEL io-wq cancellation isn't limited only to current task. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/d9a8d76d23690842f666c326631ecc2d85b6c1bc.1615566409.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-09spec: add explicit build dependency on makeStefan Hajnoczi
Fedora 34 is removing make from the buildroot. An explicit dependency is now required: https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot Adding an explicit build dependency on make seems reasonable across all rpm-based distros. It won't hurt on distros where make is always available in the buildroot. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Link: https://lore.kernel.org/r/20210309141913.262131-3-stefanha@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-09spec: bump version to 2.0Stefan Hajnoczi
The shared library is now liburing.so.2 but the pkgconfig and rpm files still say 0.7. Existing binaries link against liburing.so.1 and will not automatically pick up the new liburing.so.2 shared library. Update the version number in liburing.spec so Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Link: https://lore.kernel.org/r/20210309141913.262131-2-stefanha@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-04man/io_uring_enter.2: note that -EBUSY can also happen for geteventsJens Axboe
If we try and wait for events AND the ring is in overflow condition to the extent that it cannot be flushed, then waiting for more is nonsensical. The kernel will return -EBUSY for that condition as well. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-28Sync io_uring.h API file with Linux 5.12liburing-2.0Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-28Add test case for exiting with SQPOLL and rings created disabledJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-24Merge branch 'test-io-after-child-exit' of https://github.com/anarazel/liburingJens Axboe
* 'test-io-after-child-exit' of https://github.com/anarazel/liburing: tests: add test for using ring after a forked child exits.
2021-02-24test: use ring creation helpers where appropriateJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-24test/helpers: add ring creation helpersJens Axboe
Particularly useful for SQPOLL, where we can choose to skip a test if we don't have the necessary privileges to setup the ring. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-24helpers: prefix any helper with t_ instead of io_uring_Jens Axboe
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>
2021-02-23tests: add test for using ring after a forked child exits.Andres Freund
This case was recently broken in kernel commit 41be53e94fb0 and repaired in 8e5c66c485a8. As it's trivial to test... Signed-off-by: Andres Freund <andres@anarazel.de>
2021-02-23test/helpers: remove extra whitespaceJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-23Merge branch 'add-memalign-helper' of https://github.com/ZhiqiangLiu26/liburingJens Axboe
* 'add-memalign-helper' of https://github.com/ZhiqiangLiu26/liburing: helpers: add io_uring_create_buffers() helper helpers: add io_uring_create_file() helper helpers: add io_uring_calloc helper
2021-02-23test/Makefile: ensure dependencies and build of helpers.[ch] is saneJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-23helpers: add io_uring_create_buffers() helperZhiqiang Liu
add io_uring_create_buffers() helper, and replace create_buffers() with io_uring_create_buffers() helper. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-23helpers: add io_uring_create_file() helperZhiqiang Liu
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>
2021-02-23helpers: add io_uring_calloc helperZhiqiang Liu
add io_uring_calloc() helper, and replace all calloc() with io_uring_calloc() in all tests. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-22Merge branch 'add-memalign-helper' of https://github.com/ZhiqiangLiu26/liburingJens Axboe
* 'add-memalign-helper' of https://github.com/ZhiqiangLiu26/liburing: helpers: add io_uring_posix_memalign helper
2021-02-23helpers: add io_uring_posix_memalign helperZhiqiang Liu
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>
2021-02-22Merge branch 'fix-check-malloc' of https://github.com/ZhiqiangLiu26/liburingJens Axboe
* 'fix-check-malloc' of https://github.com/ZhiqiangLiu26/liburing: tests: add helpers.h to harden the tests
2021-02-23tests: add helpers.h to harden the testsZhiqiang Liu
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>
2021-02-19setup: cleanup probe codeJens Axboe
Style and code flow improvements. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-19Merge branch 'master' of https://github.com/ZhiqiangLiu26/liburingJens Axboe
* 'master' of https://github.com/ZhiqiangLiu26/liburing: setup: check whether malloc succ before using it
2021-02-19setup: check whether malloc succ before using itZhiqiang Liu
In io_uring_get_probe_ring func, we will call malloc() to alloc memory for probe. Considering malloc may return NULL, we should check whether malloc() succ before using it. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2021-02-18test: don't expect links to be partially executedPavel Begunkov
When we link a buggy request, the whole link collected by that moment may be cancelled even before it got issued. Don't expect it to be partially executed. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-17test: use random port in range for socket testsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-17test/fsync: use new io_uring_prep_sync_file_range() helperJens Axboe
We open coded it before, use the new helper. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-17io_uring_prep_sync_file_range: cleanupsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-17Merge branch 'master' of https://github.com/FletcherJ1/liburingJens Axboe
* 'master' of https://github.com/FletcherJ1/liburing: Added prep function for sync_file_range op
2021-02-17test/read-write: skip too-big test on non-rootJens Axboe
We can't reset the limits back afterwards without failing, so just skip this test for a regular user. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-16.gitignore: add sendmsg_fs_cveJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-02-14Added prep function for sync_file_range opjames
2021-02-13Merge branch 'Pr1' of https://github.com/romange/liburingJens Axboe
* 'Pr1' of https://github.com/romange/liburing: Add const modifier to functions that do not change the state of the ring
2021-02-13Merge branch 'uman/man7-install' of https://github.com/UmanShahzad/liburingJens Axboe
* 'uman/man7-install' of https://github.com/UmanShahzad/liburing: Install man7 pages
2021-02-13Install man7 pagesUman Shahzad
2021-02-12a test for CVE-2020-29373 (AF_UNIX path resolution)Pavel Begunkov
Add a regression test for CVE-2020-29373 where io-wq do path resolution issuing sendmsg, but doesn't have proper fs set up. Reported-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>