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: Signed-off-by: Jens Axboe <>
2021-04-06test/poll-mshot-update: test live updates of triggering requestsJens Axboe
Signed-off-by: Jens Axboe <>
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 <> Signed-off-by: Jens Axboe <>
2021-04-03test/rw_merge_test: code cleanupsJens Axboe
Signed-off-by: Jens Axboe <>
2021-03-31Merge branch 'io_merge_testcase' of Axboe
* 'io_merge_testcase' of 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: Signed-off-by: Jens Axboe <>
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 <>
2021-03-31test/pipe-reuse: ignore short readJens Axboe
Signed-off-by: Jens Axboe <>
2021-03-29test/connect: randomize connect portJens Axboe
Signed-off-by: Jens Axboe <>
2021-03-29test/socket-rw*: don't fatally error on failure to bindJens Axboe
Signed-off-by: Jens Axboe <>
2021-03-26tests: more cancellation testsPavel Begunkov
Add a test checking we don't cancel extra on exit() cancellation. Signed-off-by: Pavel Begunkov <> Signed-off-by: Jens Axboe <>
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 <>
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 <> Link: Signed-off-by: Jens Axboe <>
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 <> Link: Signed-off-by: Jens Axboe <>
2021-03-09spec: add explicit build dependency on makeStefan Hajnoczi
Fedora 34 is removing make from the buildroot. An explicit dependency is now required: 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 <> Link: Signed-off-by: Jens Axboe <>
2021-03-09spec: bump version to 2.0Stefan Hajnoczi
The shared library is now but the pkgconfig and rpm files still say 0.7. Existing binaries link against and will not automatically pick up the new shared library. Update the version number in liburing.spec so Signed-off-by: Stefan Hajnoczi <> Link: Signed-off-by: Jens Axboe <>
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 <>
2021-02-28Sync io_uring.h API file with Linux 5.12liburing-2.0Jens Axboe
Signed-off-by: Jens Axboe <>
2021-02-28Add test case for exiting with SQPOLL and rings created disabledJens Axboe
Signed-off-by: Jens Axboe <>
2021-02-24Merge branch 'test-io-after-child-exit' of Axboe
* 'test-io-after-child-exit' of 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 <>
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 <>
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 <>
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 <>
2021-02-23test/helpers: remove extra whitespaceJens Axboe
Signed-off-by: Jens Axboe <>
2021-02-23Merge branch 'add-memalign-helper' of Axboe
* 'add-memalign-helper' of 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 <>
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 <>
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 <>
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 <>
2021-02-22Merge branch 'add-memalign-helper' of Axboe
* 'add-memalign-helper' of 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 <>
2021-02-22Merge branch 'fix-check-malloc' of Axboe
* 'fix-check-malloc' of 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 <>
2021-02-19setup: cleanup probe codeJens Axboe
Style and code flow improvements. Signed-off-by: Jens Axboe <>
2021-02-19Merge branch 'master' of Axboe
* 'master' of 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 <>
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 <> Signed-off-by: Jens Axboe <>
2021-02-17test: use random port in range for socket testsJens Axboe
Signed-off-by: Jens Axboe <>
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 <>
2021-02-17io_uring_prep_sync_file_range: cleanupsJens Axboe
Signed-off-by: Jens Axboe <>
2021-02-17Merge branch 'master' of Axboe
* 'master' of 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 <>
2021-02-16.gitignore: add sendmsg_fs_cveJens Axboe
Signed-off-by: Jens Axboe <>
2021-02-14Added prep function for sync_file_range opjames
2021-02-13Merge branch 'Pr1' of Axboe
* 'Pr1' of Add const modifier to functions that do not change the state of the ring
2021-02-13Merge branch 'uman/man7-install' of Axboe
* 'uman/man7-install' of 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 <> Signed-off-by: Pavel Begunkov <> Signed-off-by: Jens Axboe <>