| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
- Fix padding in vector and sockaddr structures on 32 bit (Brett Holman)
- Add a test case for missed poll events (Eric Biggers)
- Add loongarch support (Yehui Ren)
- man page cleanup and fixes (Guillem Jover)
- assorted test harness fixess (Guillem Jover, Jeff Moyer)
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Padding for the various structures in the iocb.u union should be the
same. This patch verifies they are at build time.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The io_iocb_sockaddr structure definition is missing padding for @addr
and @len, which could result in -EINVAL being returned from
io_submit() on applications compiled for 32 bit architectures. Fix
it.
This was found after Brett reported a similar bug in the
io_iocb_vector structure.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The io_iocb_vector structure definition is missing padding for @vec
and @nr, which results in -EINVAL being returned from io_submit() on
applications compiled for 32 bit architectures. Fix it.
Signed-off-by: Brett Holman <bholman.devel@gmail.com>
[JEM: add commit message; use PADDEDul for nr]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: yehui ren <renyehui@uniontech.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>
|
|
|
|
|
| |
Signed-off-by: yehui ren <renyehui@uniontech.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>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove unnecessary macro argument quoting.
- Variables, pathnames in italics.
- Keywords in bold.
- Man page references in bold, followed by the man page number.
- Fix TP/TQ macro usage.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
- Update year.
- Balance double quotes.
- Remove version from source argument as recommended in man-pages(7).
- Fix all sections numbers to 3.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|
|
|
|
| |
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>
|
|\
| |
| |
| | |
Pull in changes that were made via the web UI.
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We need to link agaisnt -lgcc, on at least hppa, PPC and ARC.
That's because in some corner-cases like compilation with -Os
on ARC and PPC so-called millicode (basically function prologue and
epilogue) implemented in libgcc.a is used. So we end up with
GLOBAL UNDEFINED symbol in libaio.so and then on linkage of the final
applicaiton LD fails to proceed saying:
--------------------------->8----------------------
hidden symbol '__ld_r13_to_r15_ret' in .../libgcc.a(_millicodethunk_ret.o) is referenced by DSO
--------------------------->8----------------------
Also it looks like in general it is not the best idea to use either
"-nostartfiles" or "-nostdlib" when linking shared libs because
default construtor/destructor functions won't be executed, see
"5.2. Library constructor and destructor functions" in [1]
So let's stop passing "-nostdlib" and "-nostartfiles" and get required
stuff built-in libaio.
Initial patch taken from Debian [2].
Fixes build failures in Buildroot like blktrace [3], lvm2 [4].
[1] http://tldp.org/HOWTO/Program-Library-HOWTO/miscellaneous.html
[2] https://sources.debian.org/patches/libaio/0.3.111-1/01_link_libs.patch/
[3] http://autobuild.buildroot.net/results/17461209755038a30118d76acb4f43469a22a139/
[4] http://autobuild.buildroot.net/results/a5dfc87f94b97135e5cc84f6a876114891ed9dd9/
Signed-off-by: Guillem Jover <guillem@debian.org>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Add async poll support (Christoph Hellwig)
- Use canonical DESTDIR= environment variable (Thomas Petazzoni)
- Add ability to disable building the shared library (Thomas Petazzoni)
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Patch borrowed from OpenEmbedded, available at
recipes/libaio/libaio-0.3.106/destdir.patch in their source tree.
It just adds support for the traditional DESTDIR variable to install
the library in a different sysroot than the normal /.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[JEM: I couldn't verify the initial author of this change, but it's
trivial. For information on the DESTDIR convention, see:
https://www.gnu.org/prep/standards/html_node/DESTDIR.html]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently, the libaio build sytem builds a shared library
unconditionally. In some environments, this is not possible or
desirable. This commit adds a new Makefile variable, ENABLE_SHARED,
which defaults to "1" (i.e shared library enabled) and that allows to
override this behavior, and therefore to disable the build and
installation of the shared library.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
|/ /
| |
| |
| |
| |
| |
| | |
The main reason is to document that submitting patches to the mailing
list is the preferred method for contributing code.
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is ppoll/pselect equivalent for io_getevents. It atomically executes
the following sequence:
sigset_t origmask;
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ret = io_getevents(ctx, min_nr, nr, events, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
And thus allows to safely mix aio and signals, especially together with
IO_CMD_POLL. See the pselect(2) man page for a more detailed explanation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
[JEM: add sigset size parameter to io_pgetevents]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Christoph Hellwig <hch@lst.de>
|