summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-17Merge branch 'master' of https://github.com/kraj/liburingJens Axboe
* 'master' of https://github.com/kraj/liburing: examples/ucontext-cp.c: Do not use SIGSTKSZ
2021-09-17Merge branch 'ci-add-32-bit-build' of https://github.com/ammarfaizi2/liburingJens Axboe
* 'ci-add-32-bit-build' of https://github.com/ammarfaizi2/liburing: .github/workflows/build.yml: add 32-bit build
2021-09-18.github/workflows/build.yml: add 32-bit buildAmmar Faizi
Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-16test/file-verify: add provide buffers support for main test tooJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-16test/file-verify: add provide buffers test caseJens Axboe
This is another invariant where we provide buffers to the ring, and then have the read operation auto-select the buffer based on the buffer index specified. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-16man/io_uring.7: clarify how success and error returns are propagatedJens Axboe
Also make it clear that IORING_OP_READ isn't a direct match for read(2), rather it's a mix of pread(2) and preadv2(2) in that it both takes an explicit file offset, and also supports using -1 for that offset to indicate that the current file position should be used. Fixes: https://github.com/axboe/liburing/issues/435 Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-16test/file-verify: fix 32-bit build -Werror=shift-count-overflowAmmar Faizi
`off_t` may not always be 64-bit in size. ``` file-verify.c: In function 'test': file-verify.c:193:26: error: left shift count >= width of type [-Werror=shift-count-overflow] sqe->user_data = (off << 32) | i; ^ cc1: all warnings being treated as errors Makefile:164: recipe for target 'file-verify' failed make[1]: *** [file-verify] Error 1 make[1]: Leaving directory '/root/liburing/test' Makefile:12: recipe for target 'all' failed make: *** [all] Error 2 ``` Fix this by using (uint64_t) cast. Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-16.gitignore: add `test/file-verify`Ammar Faizi
Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-16test/file-verify: add verification for truncated end-of-file readJens Axboe
Attempt to read beyond the end-of-file or device, which will cause the iterator to become truncated. Do this with both the first and second half of that last chunk invalidated, so we hit retry. We fill that last chunk with known data and validate it on read completion. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-15test/socket-rw-eagain: ignore if FASTPOLL is availableJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-15test/file-verify: add read verification testJens Axboe
This test attempts to exercise the various paths that a read can take. We try and trigger incremental reads and loops, by removing page cache parts of a cached file for reading. In essence, these are the two types of iterator conditions we want to hit: 1) We get -EAGAIN immediately. This is common for buffered IO when the range isn't in page cache. 2) We get a short read, again common for buffered read. Internally, we have three different mechanisms we want to exercise, as they can behave a bit differently: 1) Using non-vectored read 1) Using non-vectored registered buffer read 3) Using vectored read, segments that fit in UIO_FASTIOV 4) Using vectored read, segments larger than UIO_FASTIOV We try and accomplish this by doing reads that hit any of these three conditions, and then we remove page cache in chunks from a file from either the front, middle, or end of the file. We do go through all of these for both buffered and O_DIRECT reads. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-15Merge branch 'pu/opt-flags' of https://github.com/guillemj/liburingJens Axboe
* 'pu/opt-flags' of https://github.com/guillemj/liburing: .github/workflows/build.yml: Pass -g -O2 -Wall -Wextra explicitly examples: Fix warnings for comparison of integers with different signedness
2021-09-15.github/workflows/build.yml: Pass -g -O2 -Wall -Wextra explicitlyGuillem Jover
As these flags are marked as optional now they get reset when we pass explicit flags. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-15examples: Fix warnings for comparison of integers with different signednessGuillem Jover
Warned-by: gcc -Wsign-compare Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-15.gitignore: add `/test/output/`Ammar Faizi
Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Link: https://lore.kernel.org/r/b9aacc68090774c08f871720d3f8b575e62f8807.1631692342.git.ammarfaizi2@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-15test/send_recv: Use proper cast for (struct sockaddr *) argumentAmmar Faizi
This commit fixes build for armv8l. Sometimes the compiler accepts (struct sockaddr_in *) to be passed to (struct sockaddr *) without cast. But not all compilers agree with that. Louvian found the following warning on armv8l: ``` send_recv.c:203:24: warning: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Wincompatible-pointer-types] ret = connect(sockfd, &saddr, sizeof(saddr)); ^~~~~~ /usr/include/sys/socket.h:308:59: note: passing argument to parameter '__addr' here __socketcall int connect(int __fd, const struct sockaddr* __addr, socklen_t __addr_length); ^ 1 warning generated. ``` Fix this by casting the second argument to (struct sockaddr *). Reported-by: Louvian Lyndal <louvianlyndal@gmail.com> Tested-by: Louvian Lyndal <louvianlyndal@gmail.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Link: https://lore.kernel.org/r/91812264f5600e1a460203d5297eb43aa978f9bf.1631692342.git.ammarfaizi2@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-15test/io_uring_setup: Don't use `__errno` as local variable nameAmmar Faizi
This commit fixes build for armv8l. On some systems, the macro `errno` is defined as `#define errno (*__errno())` It is clear that `__errno` is a global function on such systems. The problem is, `io_uring_setup.c` uses `int __errno` as a local variable, so it shadows the `__errno` function, result in the following error: ``` CC io_uring_setup io_uring_setup.c:116:12: error: called object type 'int' is not a function or function pointer __errno = errno; ^~~~~ /usr/include/errno.h:58:24: note: expanded from macro 'errno' #define errno (*__errno()) ~~~~~~~^ 1 error generated. make[1]: *** [Makefile:163: io_uring_setup] Error 1 make[1]: *** Waiting for unfinished jobs.... ``` Fix this by not using `__errno` as local variable name. Reported-by: Louvian Lyndal <louvianlyndal@gmail.com> Tested-by: Louvian Lyndal <louvianlyndal@gmail.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Link: https://lore.kernel.org/r/2d53ef3f50713749511865a7f89e27c5378e316d.1631692342.git.ammarfaizi2@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-14man/io_uring_enter.2: update notes about direct open/acceptPavel Begunkov
Reflect recent changes in the man, i.e. direct open/accept now would try to remove a file from the fixed file table if the slot they target is already taken. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/e5fe9b4c3130a5402e4328d87f214a98b39e33f7.1631642033.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-14tests: test open into taken fixed slotPavel Begunkov
Add a test case verifying opening into an already teaken fixed file slot. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/d87d67a95dc816556e3e38440bf34163fba3861f.1631632805.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-14test/timeout: improve finding exec-targetJens Axboe
The test is currently broken because it assumes that it's in the same directory, that's never the case if the test is run from the make runtests target. Try both ./exec-target and test/exec-target, that should make it work more reliably. Fixes: a802b850543f ("tests: test timeout cancellation fails links") Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-13Merge branch 'pu/syscalls' of https://github.com/guillemj/liburingJens Axboe
* 'pu/syscalls' of https://github.com/guillemj/liburing: test: Remove unused syscall number definitions test: Use syscall wrappers instead of using syscall(2) directly
2021-09-13test: Remove unused syscall number definitionsGuillem Jover
These are leftovers from when the tests used direct syscall(2) calls. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13test: Use syscall wrappers instead of using syscall(2) directlyGuillem Jover
Some of these syscalls have different entry points depending on the architecture. Use the wrappers to avoid having to reimplement them portably. Fixes build failures on Debian armel and armhf builds. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13Merge branch 'pu/test-build-ci' of https://github.com/guillemj/liburingJens Axboe
* 'pu/test-build-ci' of https://github.com/guillemj/liburing: .travis.yml: Remove unused Travis CI support .github/workflows: Simplify and unify build tests .github/workflows: Add new shellcheck CI test test/runtests.sh: Fix shellcheck directive for old versions test/empty-eownerdead: Clarify unexpected error message test/poll-cancel-ton: Remove unused variable build: Fix build flags support
2021-09-13.travis.yml: Remove unused Travis CI supportGuillem Jover
We have switched now to use GitHub actions, and Travis has changed their policy and quotas to the point of making their usage very cumbersome. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13.github/workflows: Simplify and unify build testsGuillem Jover
- Use a single definition for both gcc and clang tests, by using a matrix. - Remove redundant installation for packages present in the CI system. - Remove version printing for uninteresting programs. - Trigger for all branches, so that MRs can see results on non-master. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13.github/workflows: Add new shellcheck CI testGuillem Jover
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13test/runtests.sh: Fix shellcheck directive for old versionsGuillem Jover
The sourced file cannot be guaranteed to be present, and old shellcheck versions do not take into account the annotated suppression. Instead unconditionally redirect it to /dev/null. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13test/empty-eownerdead: Clarify unexpected error messageGuillem Jover
Old kernels incorrectly return EOWNERDEAD, catch that explicitly and print a more clear error message to avoid unsuspecting users think the test might be buggy, when it is the kernel. Reword fallback error message too to make it clear these are unexpected too. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13test/poll-cancel-ton: Remove unused variableGuillem Jover
Warned-by: clang-14 Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-13build: Fix build flags supportGuillem Jover
The usual convention is that the various *FLAGS are user controllable, and can be overridden, so anything that is essential for the build should be passed respecting that. The other usual convention is that CPPFLAGS only contain pre-processor options, CFLAGS and CXXFLAGS only contain compilation options and LDFLAGS only contain linker flags, where all of these are honored in all build rules. Switch to set optional flags conditionally into the *FLAGS variables if they are not set, and then unconditionally append any required flags. And pass the various *FLAGS to the rules as expected. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-11Merge branch 'fix-test-shmem' of https://github.com/ammarfaizi2/liburingJens Axboe
* 'fix-test-shmem' of https://github.com/ammarfaizi2/liburing: .github/workflows: fix apt warning test/io_uring_register: fix -Wimplicit-function-declaration of memfd_create
2021-09-11tests: test timeout cancellation fails linksPavel Begunkov
Test that we appropriately fail linked requests when we cancel a normal timeout. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/e9acec809a3d86cab22601fe87c963c4ffac61e6.1631358658.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-11tests: add no-op executable for execPavel Begunkov
There are differences between close and exec from io_uring perspective, so we want to test exec as well. For that we need a program doing nothing to exec into. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/ed97597635e67d750bff377bdf68d03e1eb022e5.1631358658.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-11.github/workflows: fix apt warningAmmar Faizi
Using `apt` gives the following warning: ``` WARNING: apt does not have a stable CLI interface. Use with caution in scripts. ``` Fix this by using `apt-get` instead of `apt`. On Dec 30 '17 at 15:15, dessert wrote: > apt is for the terminal and gives beautiful output while apt-get and > apt-cache are for scripts and give stable, parsable output. > Link: https://askubuntu.com/a/990838/1038828 Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-11test/io_uring_register: fix -Wimplicit-function-declaration of memfd_createAmmar Faizi
On some systems, there is no `memfd_create` function. This commit fixes this: ``` CC io_uring_register io_uring_register.c: In function 'test_shmem': io_uring_register.c:514:10: warning: implicit declaration of function 'memfd_create' [-Wimplicit-function-declaration] memfd = memfd_create("uring-shmem-test", 0); ^ ``` Fix for this is based on an answer on Stack Overflow [1]. On Jun 16 '19 at 5:12, mosvy wrote: > On older systems, you'll have to include linux/memfd.h for the MFD_ > defines, and call memfd_create() via the the syscall(2) wrapper > (and include unistd.h and sys/syscall.h for it work). > Link: https://stackoverflow.com/a/56616264/7275114 [1] Reported-by: Louvian Lyndal <louvianlyndal@gmail.com> Tested-by: Louvian Lyndal <louvianlyndal@gmail.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-10Merge branch 'github-actions-ci' of https://github.com/ammarfaizi2/liburingJens Axboe
* 'github-actions-ci' of https://github.com/ammarfaizi2/liburing: build_with_clang.yml: fix clang build error -Wunused-command-line-argument .github/workflows: add build_with_clang.yml .github/workflows: add build_with_gcc.yml
2021-09-11build_with_clang.yml: fix clang build error -Wunused-command-line-argumentAmmar Faizi
Buildling with Clang -Werror error: make[1]: Entering directory '/home/runner/work/liburing/liburing/test' clang -Werror -D_GNU_SOURCE -D__SANE_USERSPACE_TYPES__ -I../src/include/ -include ../config-host.h -Werror -D_GNU_SOURCE -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -L../src/ -o helpers.o -c helpers.c -luring clang: error: -luring: 'linker' input unused [-Werror,-Wunused-command-line-argument] make[1]: *** [Makefile:159: helpers.o] Error 1 make[1]: Leaving directory '/home/runner/work/liburing/liburing/test' make: *** [Makefile:13: all] Error 2 ##[error]Process completed with exit code 2. Fix this by adding `-Wno-unused-command-line-argument` for Clang build. Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-11.github/workflows: add build_with_clang.ymlAmmar Faizi
Add GitHub Actions build with Clang. Link: https://github.com/axboe/liburing/pull/425#issuecomment-914540396 Cc: Guillem Jover <guillem@hadrons.org> Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-11.github/workflows: add build_with_gcc.ymlAmmar Faizi
Add GitHub Actions build with GCC. Link: https://github.com/axboe/liburing/pull/425#issuecomment-914540396 Cc: Guillem Jover <guillem@hadrons.org> Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-10test/runtests.sh: fix retrieving statusJens Axboe
After adding the timing parts, we get the exit status after running date. That's obviously not very useful... Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-09test/file-register: newer kernels limit based on RLIMIT_NOFILEJens Axboe
Adjust this when testing huge file sets, as that exceeds the standard default of 1024 open files. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-09liburing.spec: bump to version 2.1Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-09liburing 2.1liburing-2.1Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-07Ignore spurious fadvise/madvise failuresJens Axboe
It's just too hard to reliably test, don't warn about it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-07Revert "test/empty-eownerdead: Only expect EOWNERDEAD as test success"Jens Axboe
This reverts commit 6e72065e39e6bb7e744c6ba24d1a62a8d84d3e27. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-07test/runtests.sh: align at 55 wideJens Axboe
If you use a parameter for the tests, we run out pretty quickly. Move the alignment to 55, that still leaves plenty of room for the duration (and prev duration). Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-07Merge branch 'pu/test-suite-shellcheck' of https://github.com/guillemj/liburingJens Axboe
* 'pu/test-suite-shellcheck' of https://github.com/guillemj/liburing: test: Disable shellcheck checks test: Declare and assign shell variable separately to not mask return value test: Do not use $ in variables within $(()) test: Add missing quotes around variables test: Pass an array to run_tests instead of an undefined variable test: Use an array instead of interpolating into a string via $@ test: Use -z instead of ! -n test: Use -n instead of ! -z
2021-09-07test: Disable shellcheck checksGuillem Jover
The first depends on an optional file which we cannot guarantee to be present. The second matches an existing check currently disabled. Warned-by: shellcheck Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-09-07test: Declare and assign shell variable separately to not mask return valueGuillem Jover
Warned-by: shellcheck Signed-off-by: Guillem Jover <guillem@hadrons.org>