| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Add a regression test for a recently-fixed kernel bug where aio polls
sometimes didn't complete even if the file is ready.
This is a cleaned-up version of the test which I originally posted at
https://lore.kernel.org/r/YbMKtAjSJdXNTzOk@sol.localdomain
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: yehui ren <renyehui@uniontech.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test 3.t exercises io_submit() with invalid addresses,
and one test attempted to pass in "-1" as an invalid
pointer. But gcc-11 realizes you cannot take an offset
from an invalid pointer, making it impossible to
compile or run this test:
> sh# make CC=gcc-11 partcheck
> make[1]: Entering directory '/alt/public_software/libaio/src'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory '/alt/public_software/libaio/src'
> make[1]: Entering directory '/alt/public_software/libaio/harness'
> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/2.t\" -o cases/2.p main.c ../src/libaio.a -lpthread
> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/3.t\" -o cases/3.p main.c ../src/libaio.a -lpthread
> In file included from main.c:24:
> cases/3.t: In function ‘test_main’:
> cases/3.t:18:19: error: ‘attempt_io_submit’ accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
> 18 | status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cases/3.t:18:19: note: referencing argument 3 of type ‘struct iocb **’
> In file included from cases/3.t:5,
> from main.c:24:
> cases/aio_setup.h:15:5: note: in a call to function ‘attempt_io_submit’
> 15 | int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect)
> | ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[1]: *** [Makefile:19: cases/3.p] Error 1
> make[1]: Leaving directory '/alt/public_software/libaio/harness'
> make: *** [Makefile:23: partcheck] Error 2
The fix is to tell gcc to relax it's stringop overflow
testing for this one test.
Changes since v1:
* First version just skipped the test in question
Signed-off-by: Lee Duncan <leeman.duncan@gmail.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Either the kernel or the syscall wrapper will return -ENOSYS when this
syscall is not implemented. So we should cope with this in the test
suite and SKIP the test case.
This is currently the case for alpha and ia64, even though they have
already been wired up very recently in the kernel mainline.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
These should help diagnose problems when dealing with error failures.
In particular this helped distinguish the problem with io_pgetevents()
not being implemented and it failing due to the sigset_t layout bug.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: fix up 80 columns violations]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This partially reverts commit d7f5065448efb49b2a26e728ff735e12ea05b62e.
The actual problem in the original code was that read() was being used
to assert whether the buffer was readable, but the kernel was instead
reading from the file descriptor and then writing into the buffer, so
no EFAULT was being generated (on architectures that do so).
We needed to use a write() so that the kernel would read from the
buffer.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This test has been broken forever. Fix it up to perform an
aio_read using the result of a regular read as the expected
return code.
Reported-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
| |
Use the new skip error code instead of failing the test. Also
add in a Local variables: section for emacs.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
On filesystems such as tmpfs the syscall might return -ENOTSUP instead
of EINVAL when it does not support the RWF_NOWAIT flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: skip the test instead of returning success]
[JEM: make the error message differentiate between kernel and fs support]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
When running the harness on a filesystem such as a tmpfs, which do not
support O_DIRECT, fallback to calls without the flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: change from duplicating the open call to using F_SETFL]
[JEM: 18 and 21 require O_DIRECT-skip if not present]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
| |
Skipped tests will not cause the test harness to return failure. An
exit status of "3" was chosen for skipped tests. This doesn't
conflict with any of the current tests.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
| |
This way we can use the exit code to check whether the tests passed or
failed, and fail the package build.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
| |
This is a recent architecture and as such does not provide legacy
support for SYS_eventfd. Declare that we need to use the new syscall.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The getconf(1) command is inherently not cross-compilation friendly.
In addition PAGESIZE depends on the specific system, even within a
specific arch, so using a hard-coded value is never safe.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even though this is the same size, as the sizeof() is derived from the
source expression, recent gcc versions will emit a warning, which is
turned into an error by -Werror:
error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression
as the source; did you mean to use the size of the destination?
[-Werror=sizeof-pointer-memaccess]
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
| |
A user can now specify "LIBAIO=/path/to/libaio.so" in order to run
the test harness against the installed library.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
| |
The result is a bitmask, so just check for the bit we're interested in.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
preadv2 and pwritev2 allow the caller to specify per-io flags.
The main driver for this support in libaio is RWF_NOWAIT, which
allows applications to specify that they don't want the submission
thread to block waiting for things such as page cache invalidation,
block instantiation, etc. This should help reduce unexpected
latencies in the submission path.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Ensure that a user is able to allocate aio-max-nr events, even
if they are spread out 1 to an io_context. This test code is
based on a reproducer posted by Mauricio Faria de Oliveira
<mauricfo@linux.vnet.ibm.com>.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move '-lpthread' after 'main.c' in the compiler command line, so that
the linker can search unresolved symbols from the test in the library.
cases/18.t:98: undefined reference to `pthread_create'
cases/18.t:103: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the following build errors:
cases/18.t:94:2: error: ignoring return value of 'write', declared with attribute warn_unused_resultg [-Werror=unused-result]
write(fd, buffer, PAGE_SIZE);
cases/8.t:17:4: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Werror=unused-result]
ftruncate(fd, 0);
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
| |
Checkpoint/Restart in userspace requires support for remapping the
aio ring buffer. cases/19.t was added to ensure that this remapping
works.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
| |
18.t hard-coded PAGE_SIZE to 4096. This patch passes the PAGE_SIZE
in from the Makefile.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
| |
- Add a test for ring buffer overflows from Dan Aloni.
- Add a test that ensures io_getevents waits for I/O completions from
Anatol Pomozov.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
| |
This is useful when, for example, testing the compat layer by
building -m32 on a 64 bit platform.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
| |
aarch64 does not implement "legacy" system calls such as eventfd. It
does, of course, support eventfd2, so use that instead.
Reported-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
| |
-Werror tripped up on unchecked return codes in fedora.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
| |
decided to check for __i386__ when deciding whether pointers should
be 32 or 64 bits. I've fixed this so that the tests build and run
properly on 32 bit platforms other than i386.
|
|
|
|
| |
- Add eventfd support (Rusty Russell)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
add 12.t: verify that ioctxs are inaccessible across fork()
|
|
|
|
|
|
| |
6.t: don't memset (slows things down)
aio_setup.h: support for _SILENT read/writes
ext2-enospc.img: test filesystem image for ENOSPC case.
|
| |
|
|
|
|
|
| |
- EFBIG fixes for 2.4.9
- check ENOSPC
|
| |
|
| |
|
| |
|
|
|