8 Commits

Author SHA1 Message Date
ohci1 4b8f3098a5 update configure info for 2.14
Co-authored-by: Pavel Begunkov<asml.silence@gmail.com>
Co-authored-by: Guillem Jover<guillem@hadrons.org>
Co-authored-by: Jens Axboe<axboe@kernel.dk>
Co-authored-by: Khem Raj<raj.khem@gmail.com>
Co-authored-by: Michael de Lang<kingoipo@gmail.com>
Co-authored-by: David Disseldorp<ddiss@suse.de>
Co-authored-by: Ming Lei<ming.lei@redhat.com>
2026-04-24 09:24:13 +08:00
Mahdi Rakhshandehroo 8027807663 Fix warnings/errors when compiling on Alpine Linux
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>
2022-02-19 22:44:14 -08:00
Ammar Faizi e4336f7d93 test/thread-exit: Fix use after free bug
When I add support for nolibc x86-64, I find this test failed.

Long story short, we provide our own `free()` that always unmaps the VM
with `munmap()`. It makes the CQE return -EFAULT because the kernel
reads unmapped user memory from the pending `write()` SQE.

I believe this test can run properly with libc build because `free()`
from libc doesn't always unmap the memory, instead it uses free list on
the userspace and the freed heap may still be userspace addressable.

Fix this by deferring the free.

Cc: Jens Axboe <axboe@kernel.dk>
Fixes: 366766bae8 ("Add test case for thread exiting with pending IO")
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/20211010063906.341014-2-ammar.faizi@students.amikom.ac.id
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-10 05:11:06 -06:00
Pavel Begunkov f4017e98b5 tests: file create/unlink cleanup
Unlink earlier if possible right after getting an fd, so tests don't
leave files when exited abnormally. Also, improve test file naming in a
couple of cases.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/abbcfa9fa56fde7e740a2c887afef74a779bf36f.1630082134.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-27 12:11:20 -06:00
Jens Axboe d7463a4746 helpers: prefix any helper with t_ instead of io_uring_
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-24 07:12:47 -07:00
Zhiqiang Liu 7679234637 helpers: add io_uring_create_file() helper
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-23 20:10:26 +08:00
Zhiqiang Liu 7bd307c836 tests: add helpers.h to harden the tests
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-23 10:10:18 +08:00
Jens Axboe 366766bae8 Add test case for thread exiting with pending IO
A thread exiting should not have its IO canceled, that should only happen
when the parent exits. Test that we are able to issue IO from a thread,
with the parent reaping the completion when the thread exits.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-21 05:38:56 -07:00