Age | Commit message (Collapse) | Author |
|
* 'master' of https://github.com/kraj/liburing:
examples/ucontext-cp.c: Do not use SIGSTKSZ
|
|
* 'ci-add-32-bit-build' of https://github.com/ammarfaizi2/liburing:
.github/workflows/build.yml: add 32-bit build
|
|
Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
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>
|
|
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>
|
|
`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>
|
|
Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
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>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
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>
|
|
* '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
|
|
As these flags are marked as optional now they get reset when we pass
explicit flags.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
Warned-by: gcc -Wsign-compare
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
* 'pu/syscalls' of https://github.com/guillemj/liburing:
test: Remove unused syscall number definitions
test: Use syscall wrappers instead of using syscall(2) directly
|
|
These are leftovers from when the tests used direct syscall(2) calls.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
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>
|
|
* '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
|
|
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>
|
|
- 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>
|
|
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
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>
|
|
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>
|
|
Warned-by: clang-14
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
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>
|
|
* '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
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
* '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
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
It's just too hard to reliably test, don't warn about it.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This reverts commit 6e72065e39e6bb7e744c6ba24d1a62a8d84d3e27.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
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>
|
|
* '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
|
|
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>
|
|
Warned-by: shellcheck
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|