summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bump libaio versionHEADlibaio-0.3.113masterJeff Moyer2022-03-282-2/+9
| | | | | | | | - 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)
* harness: add test for aio poll missed eventsEric Biggers2022-03-251-0/+255
| | | | | | | | | | | 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>
* Verify structure padding is correct at build timeJeff Moyer2021-09-292-0/+24
| | | | | | | 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>
* Fix struct io_iocb_sockaddr padding for 32bit architecturesJeff Moyer2021-09-291-2/+2
| | | | | | | | | | | | 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>
* Fix struct io_iocb_vector padding for 32bit architecturesBrett Holman2021-09-291-2/+2
| | | | | | | | | | 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>
* Use generic syscall number schema for loongarchyehui ren2021-07-201-1/+1
| | | | | Signed-off-by: yehui ren <renyehui@uniontech.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Add endian detection and bit width detection for loongarchyehui ren2021-07-201-1/+3
| | | | | Signed-off-by: yehui ren <renyehui@uniontech.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Add loongarch to supported architectures in libaio.specyehui ren2021-07-201-1/+1
| | | | | Signed-off-by: yehui ren <renyehui@uniontech.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* cases/16.t: loongarch only supports eventfd2yehui ren2021-07-201-2/+2
| | | | | Signed-off-by: yehui ren <renyehui@uniontech.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Fix test issue with gcc-11Lee Duncan2021-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* harness: Skip the test if io_pgetevents() is not implementedGuillem Jover2019-08-221-0/+7
| | | | | | | | | | | | 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>
* harness: Print better error messages on error conditions in 22.tGuillem Jover2019-08-221-6/+9
| | | | | | | | | | 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>
* harness: Fix PROT_WRITE mmap checkGuillem Jover2019-08-141-5/+4
| | | | | | | | | | | | | | | 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>
* harness: fix read into PROT_WRITE mmap testJeff Moyer2019-08-131-3/+3
| | | | | | | | | 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>
* harness: skip 22.p if async_poll isn't supportedJeff Moyer2019-07-291-1/+13
| | | | | | | 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>
* harness: Handle -ENOTSUP from io_submit() with RWF_NOWAITGuillem Jover2019-07-291-5/+7
| | | | | | | | | | 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>
* harness: Add fallback code for filesystems not supporting O_DIRECTGuillem Jover2019-07-294-5/+23
| | | | | | | | | | 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>
* harness: add support for skipping testsJeff Moyer2019-07-292-6/+28
| | | | | | | | 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>
* harness: Make the test exit with a code matching the pass/fail stateGuillem Jover2019-07-291-0/+2
| | | | | | | | 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>
* harness: Make RISC-V use SYS_eventfd2 instead of unavailable SYS_eventfdGuillem Jover2019-07-291-3/+3
| | | | | | | | 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>
* harness: Use run-time _SC_PAGE_SIZE instead of build-time PAGESIZEGuillem Jover2019-07-292-11/+25
| | | | | | | | | 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>
* harness: Use destination strncpy() expression for sizeof() argumentGuillem Jover2019-07-292-2/+2
| | | | | | | | | | | | | 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>
* Use ctx consistently for io_context_t instead of ctx_idGuillem Jover2019-07-298-13/+13
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Escape verbatim \n in order to make it through roffStephan Springl2019-07-291-6/+6
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Fold short linesGuillem Jover2019-07-292-8/+4
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Fix markupGuillem Jover2019-07-2913-124/+195
| | | | | | | | | | | - 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>
* man: Fix title headerGuillem Jover2019-07-2913-13/+13
| | | | | | | | | | - 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>
* man: Fix typosGuillem Jover2019-07-2912-16/+16
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Add "None" to empty sectionsGuillem Jover2019-07-291-0/+2
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Remove spurious textGuillem Jover2019-07-293-4/+2
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Remove spurious spacesGuillem Jover2019-07-293-3/+3
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Fix period formattingGuillem Jover2019-07-2910-25/+19
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Fix casingGuillem Jover2019-07-292-4/+4
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: End sentences with a periodGuillem Jover2019-07-298-11/+11
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Refer to libaio.h instead of libio.hGuillem Jover2019-07-291-2/+2
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Use the correct troff macro for commentsGuillem Jover2019-07-297-64/+64
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* man: Add missing space in man page referencesGuillem Jover2019-07-2913-168/+168
| | | | | Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: allow running tests against the installed libraryJeff Moyer2019-07-291-1/+5
| | | | | | | 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>
* Merge branch 'master' of ssh://pagure.io/libaiolibaio-0.3.112Jeff Moyer2018-10-221-1/+1
|\ | | | | | | Pull in changes that were made via the web UI.
| * Merge #7 `Link against libgcc to avoid unresolved symbols`Jeffrey E. Moyer2018-10-221-1/+1
| |\
| | * Link against libgcc to avoid unresolved symbolsGuillem Jover2018-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | libaio-0.3.112Jeff Moyer2018-10-221-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | | Makefile: add missing DESTDIR variable useThomas Petazzoni2018-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | src/Makefile: add ENABLE_SHARED boolean to allow static-only buildThomas Petazzoni2018-10-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Add README.mdJeff Moyer2018-10-221-0/+12
|/ / | | | | | | | | | | | | 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>
* | harness: fix POLLIN test caseJeff Moyer2018-10-221-1/+1
| | | | | | | | | | | | The result is a bitmask, so just check for the bit we're interested in. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* | Merge branch 'aio-poll'Jeff Moyer2018-10-2211-32/+335
|\ \ | |/ |/|
| * add test for aio poll and io_pgeteventsaio-pollChristoph Hellwig2018-01-161-0/+149
| | | | | | | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
| * add support for io_pgeteventsChristoph Hellwig2018-01-167-4/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * move the aio_ring defintion and empty check into a headerChristoph Hellwig2018-01-162-25/+52
| | | | | | | | Signed-off-by: Christoph Hellwig <hch@lst.de>