aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/aio
Commit message (Collapse)AuthorAgeFilesLines
* tests/aio: Avoid skipping zvol testsMark Johnston2026-04-201-5/+0
| | | | | | The underlying bugs which caused them to be flaky are now fixed. PR: 258766
* aio(4) tests: do not rely on (int *)-1 being invalid addressAlan Somers2026-02-171-1/+6
| | | | | | Explicitly mmap guard and use it as the invalid address instead. MFC after: 1 week
* tests/aio: Add support for larger max_buf_aio to vectored_big_iovcnt testOlivier Cochard2025-10-071-5/+7
| | | | | | | | | | | | | | Fix a test failure that occurs when max_buf_aio exceeds 31, as the calculated buffer size exceeds the 16 KB memory disk device. Increase the MD device size to 1 MB to prevent truncation. Rename MD_LEN to DEVICE_IO_LEN for clarity and add a more descriptive error message. Reviewed by: asomers Approved by: asomers Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D52914
* tests/sys/aio: use require.kmods property instead of ad-hoc checksSiva Mahadevan2025-09-055-37/+3
| | | | | | | Signed-off-by: Siva Mahadevan <me@svmhdvn.name> Sponsored by: The FreeBSD Foundation Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1780
* aio_kqueue_test: Fix CID 1558429David Bright2025-01-091-0/+2
| | | | | | | | | Fix a Coverity error in the aio_kqueue_test that could theoretically (but probably not realistically) cause overindexing an array. Differential Revision: https://reviews.freebsd.org/D48328 Reviewed by: asomers, vangyzen Sponsored by: Dell Technologies
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-165-10/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* aio tests: Use unique names for zvolsMark Johnston2023-03-301-18/+25
| | | | | | Otherwise tests which create zvols cannot be run in parallel. MFC after: 1 week
* Reap dead code in lio_kqueue_test and aio_kqueue_testAlan Somers2022-07-242-8/+4
| | | | | MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35358
* Add more aio testsAlan Somers2022-07-241-3/+151
| | | | | | | | | * Add tests for kqueue completion with all file types. * Add a test for kqueue completion with EV_ONESHOT. * Cleanup an unused variable. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35359
* Temporarily skip flaky tset cases under sys.aio.aio_test in CILi-Wen Hsu2021-09-281-0/+5
| | | | | | | | - sys.aio.aio_test.vectored_unaligned - sys.aio.aio_test.vectored_zvol_poll PR: 258766 Sponsored by: The FreeBSD Foundation
* aio_test: Validate interactions between AIO on sockets and shutdown(2)Mark Johnston2021-09-171-0/+68
| | | | | | Reviewed by: asomers, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31976
* lio_test: Specify a mode with O_CREATMark Johnston2021-09-111-2/+2
| | | | Sponsored by: The FreeBSD Foundation
* aio: Interlock with listen(2)Mark Johnston2021-09-101-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | soo_aio_queue() did not handle the possibility that the provided socket is a listening socket. Up until recently, to fix this one would have to acquire the socket lock first and check, since the socket buffer locks were destroyed by listen(2). Now that the socket buffer locks belong to the socket, simply check SOLISTENING(so) after acquiring them, and make listen(2) return an error if any AIO jobs are enqueued on the socket. Add a couple of simple regression test cases. Note that this fixes things only for the default AIO implementation; cxgbe(4)'s TCP offload has a separate pru_aio_queue implementation which requires its own solution. Reported by: syzbot+c8aa122fa2c6a4e2a28b@syzkaller.appspotmail.com Reported by: syzbot+39af117d43d4f0faf512@syzkaller.appspotmail.com Reported by: syzbot+60cceb9569145a0b993b@syzkaller.appspotmail.com Reported by: syzbot+2d522c5db87710277ca5@syzkaller.appspotmail.com Reviewed by: tuexen, gallatin, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31901
* Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD.Thomas Munro2021-08-221-0/+7
| | | | | | | | | | Add missing wrapper code to librt for these new functions so that SIGEV_THREAD works. Without machinery to convert it to SIGEV_THREAD_ID, you got EINVAL. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31618
* lio_listio(2): Allow LIO_READV and LIO_WRITEV.Thomas Munro2021-08-221-22/+87
| | | | | | | | | | | | | Allow multiple vector IOs to be started with one system call. aio_readv() and aio_writev() already used these opcodes under the covers. This commit makes them available to user space. Being non-standard extensions, they're only visible if __BSD_VISIBLE is defined, like the functions. Reviewed by: asomers, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31627
* aio: revert the workaround for bug 251828 in the testsAlan Somers2021-08-141-7/+0
| | | | | | | | | | | | | This bug is no longer reproducible in 14.0-CURRENT and 13.0-RELEASE Do not MFC to stable/12 ! PR: 251828 Reported by: markj Reviewed by: markj MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D31535
* aio_md_test: label the mdEric van Gyzen2021-07-231-0/+2
| | | | | | | | | Add a label to md devices created by this test. The next time this test leaks md devices, finding the culprit will be much easier. Thanks to: sobomax, for adding labels in r322969 MFC after: 1 week Sponsored by: Dell EMC Isilon
* aio_md_test: NUL-terminate result of readlinkEric van Gyzen2021-07-231-1/+2
| | | | | | | | | | readlink does not NUL-terminate the output buffer. This led to spurious failures to destroy the md device because the unit number was garbage. NUL-terminate the output buffer. Reported by: ASLR MFC after: 1 week Sponsored by: Dell EMC Isilon
* aio_md_test: fix cleanupEric van Gyzen2021-07-231-7/+9
| | | | | | | | | | | ATF cleanup functions cannot use functions such as ATF_REQUIRE and atf_tc_fail. These functions assert that a test case is currently running, which is not true during cleanup, so the process aborts. Change the cleanup function to simply print to stderr and return. MFC after: 1 week Sponsored by: Dell EMC Isilon
* lio_listio: Don't post a completion notification if none was requestedMark Johnston2021-07-161-0/+10
| | | | | | | | | | | | | | | One is allowed to use LIO_NOWAIT without specifying a sigevent. In this case, lj->lioj_signal is left uninitialized, but several code paths examine liov_signal.sigev_notify to figure out which notification to post. Unconditionally initialize that field to SIGEV_NONE. Add a dumb test case which triggers the bug. Reported by: KMSAN+syzkaller Reviewed by: asomers MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31197
* lio_listio: validate aio_lio_opcodeAlan Somers2021-01-121-0/+51
| | | | | | | | | | | | | | | Previously, we would accept any kind of LIO_* opcode, including ones that were intended for in-kernel use only like LIO_SYNC (which is not defined in userland). The situation became more serious with 022ca2fc7fe08d51f33a1d23a9be49e6d132914e. After that revision, setting aio_lio_opcode to LIO_WRITEV or LIO_READV would trigger an assertion. Note that POSIX does not specify what should happen if aio_lio_opcode is invalid. MFC-with: 022ca2fc7fe08d51f33a1d23a9be49e6d132914e Reviewed by: jhb, tmunro, 0mp Differential Revision: <https://reviews.freebsd.org/D28078
* aio: fix the tests when ZFS is not availableAlan Somers2021-01-101-0/+4
| | | | | | | | Don't try to cleanup the zpool if we couldn't create a zpool in the first place. Submitted by: tmunro MFC-with: 022ca2fc7fe08d51f33a1d23a9be49e6d132914e
* aio_fsync(2): Support O_DSYNC.Thomas Munro2021-01-081-5/+18
| | | | | | | aio_fsync(O_DSYNC, ...) is the asynchronous version of fdatasync(2). Reviewed by: kib, asomers, jhb Differential Review: https://reviews.freebsd.org/D25071
* Add aio_writev and aio_readvAlan Somers2021-01-031-67/+672
| | | | | | | | | | | | | | POSIX AIO is great, but it lacks vectored I/O functions. This commit fixes that shortcoming by adding aio_writev and aio_readv. They aren't part of the standard, but they're an obvious extension. They work just like their synchronous equivalents pwritev and preadv. It isn't yet possible to use vectored aiocbs with lio_listio, but that could be added in the future. Reviewed by: jhb, kib, bcr Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27743
* AIO tests: update expected failure messages after r368265Alan Somers2020-12-021-7/+2
| | | | | | | | | PR: 220398, 251515 MFC after: 1 week MFC-With: r368265 Notes: svn path=/head/; revision=368272
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-011-2/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* lio_listio_empty_nowait_thread sometimes does *not* hang.Bryan Drewery2020-01-041-0/+1
| | | | | | | | | The other tests consistently do hang though. Sponsored by: DellEMC Notes: svn path=/head/; revision=356352
* Revert r337929Alan Somers2018-08-162-4/+0
| | | | | | | | | | FreeBSD's mkstemp sets the temporary file's permissions to 600, and has ever since mkstemp was added in 1987. Coverity's warning is still relevant for portable programs since OpenGroup does not require that behavior, and POSIX didn't until 2008. But none of these programs are portable. Notes: svn path=/head/; revision=337930
* Fix Coverity warnings about mkstemp in testsAlan Somers2018-08-162-0/+4
| | | | | | | | | | | | | umask(2) should always be used prior to mkstemp(3) so the temporary file won't be created with insecure permissions. Reported by: Coverity CID: 1331605 1347173 1375366 1339800 1331604 1296056 1296060 CID: 1296057 1296062 MFC after: 2 weeks Notes: svn path=/head/; revision=337929
* lio_listio: return EAGAIN instead of EIO when out of resourcesAlan Somers2018-04-162-0/+73
| | | | | | | | | | | This behavior is already documented by the man page, and suggested by POSIX. Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D15099 Notes: svn path=/head/; revision=332631
* Revert r318180 and re-enable AIO tests on md(4) by default.John Baldwin2018-03-191-1/+0
| | | | | | | | | | | | | | | | | The 'physio' fast-path used by AIO requests on md(4) devices, is not gated on the unsafe_aio knob. Prior to r327755, some AIO requests could fail the fast-path and fall back to the slow-path (requests for devices not supporting unmapped I/O and requests which failed with EFAULT during the fast-path). However, those cases now return a suitable error rather than using the slow-path. PR: 217261 Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14742 Notes: svn path=/head/; revision=331221
* aio_kqueue_test: fix the build when DEBUG=1Alan Somers2018-03-171-3/+10
| | | | | | | Also, make the debug output more verbose Notes: svn path=/head/; revision=331104
* aio: add an ATF test case for aio_fsync error conditionsAlan Somers2018-03-171-0/+37
| | | | Notes: svn path=/head/; revision=331103
* Fix build on arm after r325817Alan Somers2017-11-141-5/+5
| | | | | | | | | | Reported by: rpokala MFC after: 3 weeks X-MFC-With: 325817 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=325827
* AIO tests: increase limitsAlan Somers2017-11-142-27/+39
| | | | | | | | | | | | | | | | | tests/sys/aio/aio_kqueue_test.c Instead of using a hard-coded queue depth, use vfs.aio.max_aio_queue_per_proc tests/sys/aio/lio_kqueue_test.c The old, small limit on lio_listio's operation count was lifted by change 324941. Raise the operation count as high as possible without exceeding the process's operation limit. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=325817
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+2
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Fix cosmetic issue with error messageEnji Cooper2017-08-021-2/+2
| | | | | | | | | | Add missing space in error message related to PR noted. MFC after: 2 weeks PR: 220398 Notes: svn path=/head/; revision=321918
* Implement SIGEV_THREAD notifications for lio_listio(2)Alan Somers2017-07-211-2/+2
| | | | | | | | | | | | | Our man pages have always indicated that this was supported, but in fact the feature was never implemented for lio_listio(2). Reviewed by: jhb, kib (earlier version) MFC after: 20 days Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11680 Notes: svn path=/head/; revision=321332
* Remove dead code that was killed by r320975Alan Somers2017-07-191-9/+4
| | | | | | | | | | | Reported by: Coverity CID: 1377977 MFC after: 15 days X-MFC-With: 320975 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=321206
* Add regression tests for bugs 220459 and 220398Alan Somers2017-07-172-0/+148
| | | | | | | | | | | | | | | Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0 Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD PR: 220459 PR: 220398 Reviewed by: cem, jhb MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11470 Notes: svn path=/head/; revision=321082
* Fix the build with GCC after r320975Alan Somers2017-07-141-1/+1
| | | | | | | | | | Reported by: pfg MFC after: 20 days X-MFC-With: 320975 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=321001
* Add tests for aio(4) completion notification via signals and threadsAlan Somers2017-07-131-39/+212
| | | | | | | | | | Reviewed by: jhb MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468 Notes: svn path=/head/; revision=320975
* Use ATF cleanup routines in aio_test.cAlan Somers2017-07-132-261/+78
| | | | | | | | | | | | | | | | Remove aio_test's legacy timeout handling and cleanup routines. Instead, use ATF's builtin capabilities. ATF automatically cleans up newly created files, too, so we don't have to explicitly unlink them. The only tests than need a cleanup routine are the md(4) tests, which must destroy their md device. Reviewed by: jhb MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468 Notes: svn path=/head/; revision=320974
* tests/sys/aio: Add missing mode to open() calls with O_CREAT.Jilles Tjoelker2017-06-041-3/+3
| | | | Notes: svn path=/head/; revision=319590
* Fix build of AIO tests with -DDEBUGAlan Somers2017-05-212-10/+13
| | | | | | | | | Also, redefine some constants for clarity. No functional change. MFC after: 1 week Notes: svn path=/head/; revision=318593
* Mark all md tests as requiring unsafe AIO in order to functionEnji Cooper2017-05-111-0/+1
| | | | | | | | | | | | | | | | | | | These tests have been flapping (failing<->passing) on Jenkins for months. It passes reliably for me if unsafe AIO is permitted, but it doesn't pass on Jenkins reliably if unsafe AIO is disabled (the current default). Mark the tests as requiring unsafe AIO to mitigate the intermittent failures when unsafe AIO isn't permitted. If the kernel code is changed to reliably function with md(4) devices using unsafe AIO, this commit can be reverted. MFC after: 2 months PR: 217261 Reported by: Jenkins Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318180
* Remove unused constant (PATH_TEMPLATE)Enji Cooper2017-05-091-2/+0
| | | | | | | | | | | It was made unnecessary in r312913. MFC after: 3 weeks MFC with: r312913 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318107
* style(9): move function definition curly braces to column 0Enji Cooper2017-05-091-3/+6
| | | | | | | | MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318100