Back when I was adding nolibc support for liburing, I added new
wrapper functions for io_uring system calls. They are ____sys_io_uring*
functions (with 4 underscores), all defined as an inline function.
I left __sys_uring* functions (with 2 underscores) live in syscall.c
because I thought it might break the user if we delete them. But it
turned out that I was wrong, no user should use these functions
because we don't export them. This situation is reflected in
liburing.map and liburing.h which don't have those functions.
Do these:
1) Delete src/syscall.c.
2) Rename ____sys_io_uring* to __sys_io_uring*.
3) Fix tests that still depend on libc `errno` for checking
__sys_io_uring* functions error code.
to:
1) Reduce the burden of maintaining syscall.c.
2) Simplify the Makefile, no need extra branch to compile syscall.c
with a specific condition.
3) Simplify function naming and kill the confusion of deciding
using __sys_uring* or ____sys_io_uring* when adding a new test that
directly calls them. Because now we always use __sys_io_uring*.
____sys_io_uring* functions no longer exist.
After this patch, __sys_io_uring* functions now return -errno instead
of -1 when fails.
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Link: https://lore.kernel.org/r/20220721090443.733104-1-ammarfaizi2@gnuweeb.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Test liburing nolibc functionality. The first use case of this test is
to test get_page_size() function as we don't seem to have a test that
tests this path. This is especially important for aarch64 because we
rely on reading /proc/self/auxv rather than hard coding it like what we
do for x86 and x86-64. We may add more nolibc tests in this file in the
future.
Reviewed-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Link: https://lore.kernel.org/r/20220705073920.367794-9-ammar.faizi@intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
send_recvmsg uses it for actual IO, this one is more about just
testing the various cases for registration and mixing with classic
buffers that should not work.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
* xattr:
32-bit build warning cleanups
test/xattr: don't fail on kernels not supporting the feature
test/xattr: style fixups
test/xattr: specify file mode with O_CREAT
liburing: Add new test program to verify xattr support
liburing: Add helper functions for fgetxattr and getxattr
liburing: add helper functions for setxattr and fsetxattr
liburing: Update io_uring in liburing
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Test case that tests the basic functionality of openat with direct
descriptors and asking io_uring to allocate the descriptors.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
* cancel-fd-all:
test/poll-cancel-all: add async read test case
test/poll-cancel-all: test IORING_ASYNC_CANCEL_ANY
io_uring.h: add IORING_ASYNC_CANCEL_ANY
test/poll-cancel-all: abort test if cancel flags not supported
test/poll-cancel-all: add test case canceling a subset of pending
test/poll-cancel-all: test issuing CANCEL_ALL | CANCEL_FD
liburing.h: add io_uring_prep_cancel_fd()
io_uring: add new cancel flags
Make it easy to manage and find by sorting it alphabetically. Also, add
a comment to remind us to keep it sorted alphabetically.
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
What we want is a .PHONY build target that depends on runtests-parallel,
not a .PHONY variable. This variable doesn't do anything. Remove it.
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Not complete yet, but tests the basic functionality of canceling based
on a file descriptor and canceling all requests pending with just a
single cancelation request.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
When adding a new test, we often forget to add the new test binary to
`.gitignore`. Append `.t` to the test binary filename, this way we can
use a wildcard matching "test/*.t" in `.gitignore` to ignore all
test binary files.
Goals:
- Make the .gitignore simpler.
- Avoid the burden of adding a new test to .gitignore.
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Link: https://lore.kernel.org/r/20220403182200.259937-4-ammarfaizi2@gnuweeb.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Summary:
This adds a new test program to test the xattr support:
- fgetxattr
- fsetxattr
- getxattr
- setxattr
It also includes test cases for failure conditions and
for passing in an invalid sqe. The test case for checking
of invalid SQE, must be enabled by defining
DESTRUCTIVE_TESTING.
Signed-off-by: Stefan Roesch <shr@fb.com>
Link: https://lore.kernel.org/r/20220323154457.3303391-5-shr@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
If we do:
<open fileX into slot 0>
<open fileY into slot 0><read slot 0><close slot 0>
this should be consistent with not having opened fileX first, and the
read should be satisfied from fileY.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Test case for the regression fixed by:
commit 6e295a664efd083ac9a5c1a8130c45be1db0cde7
Author: Jens Axboe <axboe@kernel.dk>
Date: Tue Mar 22 13:11:28 2022 -0600
io_uring: fix assuming triggered poll waitqueue is the single poll
Signed-off-by: Jens Axboe <axboe@kernel.dk>
If the ring is created with this flag, then we expect submissions to
continue even if we hit an error in a batch. Check if that is the case
or not.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
read(2)/write(2) and friends support sequential reads without giving an
explicit offset. The result of these should leave the file with an
incremented offset.
Add tests for both read and write to check that io_uring behaves
consistently in these scenarios. Expect that if you queue many
reads/writes, and set the IOSQE_IO_LINK flag, that they will behave
similarly to calling read(2)/write(2) in sequence.
Set IOSQE_ASYNC as well in a set of tests. This exacerbates the problem by
forcing work to happen in different threads to submission.
Also add tests for not setting IOSQE_IO_LINK, but allow the file offset to
progress past the end of the file.
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Update configure and test/Makefile, such that if !CONFIG_HAVE_STATX will
not generate statx.c test. Without this patch, liburing fails to compile
on an older toolchain that does not have statx available.
Fixes: #516
Signed-off-by: Jon Kohler <jon@nutanix.com>
There are still discussions about the API, and hence the feature will
miss the 5.17 kernel release. As the API is likely to change, remove
the getdents support for now and we can re-add it when it's finalized.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This should just get ignored by the kernel, so check that it is. This
is fixed by kernel commit:
commit 7b9762a5e8837b92a027d58d396a9d27f6440c36
Author: Jens Axboe <axboe@kernel.dk>
Date: Wed Dec 22 20:26:56 2021 -0700
io_uring: zero iocb->ki_pos for stream file types
Signed-off-by: Jens Axboe <axboe@kernel.dk>