summaryrefslogtreecommitdiffstats
path: root/tests/sys
Commit message (Collapse)AuthorAgeFilesLines
* MFC r310786, r310803, r310985, r311894asomers2017-01-2615-427/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r310786: Reduce the runtime of the GELI tests There is no reduction in test coverage. On my system runtime is reduced from 38m32s to 6m24s. tests/sys/geom/class/eli/conf.sh tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh tests/sys/geom/class/eli/onetime_test.sh Move the looping code into common functions in conf.sh, and remove alias ciphers from the list. tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Move a few commands that don't need to be in the inner loop out. tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Reduce the sector count tests/sys/geom/class/eli/Makefile tests/sys/geom/class/eli/init_alias_test.sh Add a test for initializing a GELI device using one of the cipher aliases, and check that the alias is correctly interpreted. MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8814 r310803: ATFify the gnop tests Also, add test cases for the -p, -P, and -s options to gnop create Reviewed by: ngie MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D8892 r310985: Update ObsoleteFiles.inc for r310803 MFC after: 26 days X-MFC-with: 310803 r311894: Fix typo from change 310985 in ObsoleteFiles.inc MFC after: 16 days X-MFC-With: 310803 Sponsored by: Spectra Logic Corp
* MFC r312111:ngie2017-01-171-1/+1
| | | | Remove unused vars to fix -Wunused issues
* MFC r312118,r312121:ngie2017-01-171-1/+1
| | | | | | | | | | | | | | | r312118: Fix -Wformat issue with zero-length format string passed to err(3) Tested with: clang, gcc 4.2.1, gcc 4.9 r312121: Follow up to r312118 State that execve failed instead of just printing out the program name and strerror(errno) via err(3).
* MFC r309464:ngie2017-01-141-1/+1
| | | | | | | | | | | Expect 01:main to fail Changes were made to ZFS in the past year with respect to how ACLs are handled, causing failures in this test. Mark it TODO so (hopefully) someone more knowledgeable (like mav or trasz) will fix the code or the test. PR: 212323
* MFC r311522:kib2017-01-131-2/+4
| | | | Use type-independent formats for printing nlink_t and ino_t.
* MFC r305148:bdrewery2017-01-032-0/+37
| | | | DIRDEPS_BUILD: Add some missing dirctories to the build.
* MFC r309957: Add tests for reaper receiving SIGCHLD (r309886).jilles2016-12-261-0/+162
| | | | PR: 213928
* MFC r309836: Add some tests for reaper functionality (in procctl()).jilles2016-12-182-0/+495
|
* MFC ↵ngie2016-12-073-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701,r307702: r306030: Port vnode_leak_test:main to FreeBSD Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes` The awk filtering method employed in NetBSD doesn't work on FreeBSD r306031: Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD Use kldstat -m to determine whether or not a filesystem is loaded. This works well with tmpfs, ufs, and zfs r306033: Port sizes_test and statvfs_test to FreeBSD Similar to r306030, use a simpler method for getting the value of `hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't work on FreeBSD r306036: Port to mknod_test and readdir_test to FreeBSD The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use mkfifo instead to create named pipes (FIFOs). r306038: Port vnd_test to FreeBSD Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD. TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3" (in both the FreeBSD and NetBSD cases). r307190: Skip :uchg on FreeBSD Unfortunately removing files with uchg set always succeeds with root on FreeBSD. Unfortunately running the test as an unprivileged user isn't doable because mounting tmpfs requires root PR: 212861 r307196: Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD - Add inttypes.h #include for PRId64 macro - Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter. Use sizeof(fhandle_t) instead as the size of fhp is always fixed as fhandle_t, unlike NetBSD's copy of fhp, which is void*. r307204: Expect :large to fail on FreeBSD FreeBSD doesn't appear to validate large -o size values like NetBSD does PR: 212862 r307205: Change atf_skip call to atf_expect_fail to make it clear that a failure is expected PR: 212861 Suggested by: jmmv r307701: Expect tests/sys/fs/tmpfs/link_test:kqueue to fail It fails with: "dir/b did not receive NOTE_LINK" Also, add needed cleanup logic to cleanup the mountpoint after the fact PR: 213662 r307702: Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite as tests/sys/fs These testcases exercise tmpfs support
* MFC r306962:ngie2016-12-071-0/+18
| | | | | | | r306962 (by br): Ensure data in pipe is available to read. Useful for latest (5th, direct mode) test only.
* MFC r304797,r305467,r305468,r305483:ngie2016-12-0313-30/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304797 (by jmmv): Make use of Kyua's work directories. Change the vnode tests to use the current directory when creating temporary files, which we can assume is a volatile work directory, and then make the kqueue_test.sh driver _not_ abandon the directory created by Kyua. This makes the various kqueue tests independent of each other, and ensures the temporary file is cleaned up on failure. Problem spotted by asomers@ when reviewing D4254. r305467: Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/... This is being done to clearly distinguish the libkqueue tests from the (soon to be imported) NetBSD tests. r305468: Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/... proc2_test must be skipped because the invariant tested (`ke.fflags & NOTE_TRACKERR`) doesn't pass. r305483: Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper format specifier for pointers when printing them out with printf(3) Pointyhat to: ngie
* MFC r302474 (By gnn)hiren2016-11-152-1/+112
| | | | | | | | | | | | On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows setting a 32 bit value on each socket. This can be used by applications and DTrace as a rendezvous point so that an applicaton's data can more easily be captured at run time. Expose the user cookie via DTrace by updating the translator in tcp.d and add a quick test program, a TCP server, that sets the cookie on each connection accepted. Sponsored by: Limelight Networks
* MFC r305963,r305970:ngie2016-10-211-1/+1
| | | | | | | | | | | r305963: Reindent TESTSDIR definition for consistency/readability r305970: Remove change accidentally committed via r305963 for upcoming tests/sys/fs/... work
* MFC r305916,r305918:ngie2016-10-211-0/+6
| | | | | | | | | | | | | | | | r305916: Make sure $TMPDIR is created with 0755 permissions This is required to ensure that the temporary script can be executed, as the default mode is apparently too restrictive r305918: Only chmod $TMPDIR if it's not /tmp This is a safety belt to ensure that the /tmp sticky bit stuff doesn't get whacked by accident if someone runs the script outright
* MFC r305676: wait: Do not copyout uninitialized status/rusage/wrusage.jilles2016-10-102-0/+71
| | | | | | | | If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and wrusage information should not be returned. PR: 212048 Reported by: Casey Lucas
* MFC r306588:kib2016-10-093-8/+10
| | | | Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so.
* MFC r305357:ngie2016-09-181-23/+29
| | | | | | Skip testcases 9/10 if jail(8) isn't installed These testcases require jail support
* MFC r305356:ngie2016-09-181-0/+1
| | | | | | | Add a missing "Bail out!" if zpool create fails This will make the exit info more meaningful if/when zpool create fails, and establishes parity with the other 2 zfs acl testcases (01, 03).
* MFC r304238:ngie2016-08-281-1/+4
| | | | | | Only expect :encode_tv_random_million to fail on 64-bit platforms It passes on i386
* MFC r304040:ngie2016-08-285-6/+6
| | | | | | | Redirect the output of the testcases to stderr instead of redirecting it to /dev/null This will aid in debugging failures
* MFC 303001: Add PTRACE_VFORK to trace vfork events.jhb2016-08-191-0/+126
| | | | | | | | | First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes.
* MFC 302900,302902,302921,303461,304009:jhb2016-08-151-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC 303406,303501: Fix panic when using aio_fsync().jhb2016-08-051-0/+83
| | | | | | | | | | | | | | | | | 303406: Adjust tests in fsync job scheduling loop to reduce indentation. 303501: Fix locking issues with aio_fsync(). - Use correct lock in aio_cancel_sync when dequeueing job. - Add _locked variants of aio_set/clear_cancel_function and use those to avoid lock recursion when adding and removing fsync jobs to the per-process sync queue. - While here, add a basic test for aio_fsync(). PR: 211390 Approved by: re (kib)
* Fix bitstring allocation on 32-bit platformsasomers2016-06-241-0/+12
| | | | | | | | | | | | | | | | sys/sys/bitstring.h Fix a rounding calculation that could undersize a bitstring on 32-bit platforms. tests/sys/sys/bitstring_test.h Add a test for bitstr_size PR: 210260 Reported by: Mark Millard Reviewed by: gibbs Approved by: re (marius) Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6848
* Account for AIO socket operations in thread/process resource usage.jhb2016-06-211-0/+11
| | | | | | | | | | | | | | | | | | | File and disk-backed I/O requests store counts of read/written disk blocks in each AIO job so that they can be charged to the thread that completes an AIO request via aio_return() or aio_waitcomplete(). This change extends AIO jobs to store counts of received/sent messages and updates socket backends to set these counts accordingly. Note that the socket backends are careful to only charge a single messages for each AIO request even though a single request on a blocking socket might invoke sosend or soreceive multiple times. This is to mimic the resource accounting of synchronous read/write. Adjust the UNIX socketpair AIO test to verify that the message resource usage counts update accordingly for aio_read and aio_write. Approved by: re (hrs) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6911
* Skip sys/acl tests on systems lacking perlasomers2016-06-201-2/+2
| | | | | | | | | | | tests/sys/acl/Makefile add perl to the required_programs for all tests in this directory Reviewed by: ngie Approved by: re (gjb) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6870
* Return the correct status when a partially completed request is cancelled.jhb2016-05-241-0/+69
| | | | | | | | | | | | | | After the previous changes to fix requests on blocking sockets to complete across multiple operations, an edge case exists where a request can be cancelled after it has partially completed. POSIX doesn't appear to dictate exactly how to handle this case, but in general I feel that aio_cancel() should arrange to cancel any request it can, but that any partially completed requests should return a partial completion rather than ECANCELED. To that end, fix the socket AIO cancellation routine to return a short read/write if a partially completed request is cancelled rather than ECANCELED. Sponsored by: Chelsio Communications
* Don't prematurely return short completions on blocking sockets.jhb2016-05-241-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | Always requeue an AIO job at the head of the socket buffer's queue if sosend() or soreceive() returns EWOULDBLOCK on a blocking socket. Previously, requests were only requeued if they returned EWOULDBLOCK and completed no data. Now after a partial completion on a blocking socket the request is queued and the remaining request is retried when the socket is ready. This allows writes larger than the currently available space on a blocking socket to fully complete. Reads on a blocking socket that satifsy the low watermark can still return a short read (same as read()). In order to track previously completed data, the internal 'status' field of the AIO job is used to store the amount of previously computed data. Non-blocking sockets continue to return short completions for both reads and writes. Add a test for a "large" AIO write on a blocking socket that writes twice the socket buffer size to a UNIX domain socket. Sponsored by: Chelsio Communications
* Add bit_count to the bitstring(3) apiasomers2016-05-231-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a bit_count function, which efficiently counts the number of bits set in a bitstring. sys/sys/bitstring.h tests/sys/sys/bitstring_test.c share/man/man3/bitstring.3 Add bit_alloc sys/kern/subr_unit.c Use bit_count instead of a naive counting loop in check_unrhdr, used when INVARIANTS are enabled. The userland test runs about 6x faster in a generic build, or 8.5x faster when built for Nehalem, which has the POPCNT instruction. sys/sys/param.h Bump __FreeBSD_version due to the addition of bit_alloc UPDATING Add a note about the ABI incompatibility of the bitstring(3) changes, as suggested by lidl. Suggested by: gibbs Reviewed by: gibbs, ngie MFC after: 9 days X-MFC-With: 299090, 300538 Relnotes: yes Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6255
* Commit a missing change from 299090asomers2016-05-231-2/+0
| | | | | | | | | | | tests/sys/kern/Makefile Reenable a disabled compiler warning, the need for which was eliminated by r299090. Reviewed by: ngie MFC after: 4 weeks X-MFC-With: 299090 Sponsored by: Spectra Logic Corp
* kern_descrip_test: Fix trivial buffer overrun with readlink(2)cem2016-05-121-1/+2
| | | | | | Reported by: Coverity CID: 1229965, 1229972 Sponsored by: EMC / Isilon Storage Division
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-0449-203/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* Improve performance and functionality of the bitstring(3) apiasomers2016-05-043-0/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow for efficient searching of set or cleared bits starting from any bit offset within the bit string. Performance is improved by operating on longs instead of bytes and using ffsl() for searches within a long. ffsl() is a compiler builtin in both clang and gcc for most architectures, converting what was a brute force while loop search into a couple of instructions. All of the bitstring(3) API continues to be contained in the header file. Some of the functions are large enough that perhaps they should be uninlined and moved to a library, but that is beyond the scope of this commit. sys/sys/bitstring.h: Convert the majority of the existing bit string implementation from macros to inline functions. Properly protect the implementation from inadvertant macro expansion when included in a user's program by prefixing all private macros/functions and local variables with '_'. Add bit_ffs_at() and bit_ffc_at(). Implement bit_ffs() and bit_ffc() in terms of their "at" counterparts. Provide a kernel implementation of bit_alloc(), making the full API usable in the kernel. Improve code documenation. share/man/man3/bitstring.3: Add pre-exisiting API bit_ffc() to the synopsis. Document new APIs. Document the initialization state of the bit strings allocated/declared by bit_alloc() and bit_decl(). Correct documentation for bitstr_size(). The original code comments indicate the size is in bytes, not "elements of bitstr_t". The new implementation follows this lead. Only hastd assumed "elements" rather than bytes and it has been corrected. etc/mtree/BSD.tests.dist: tests/sys/Makefile: tests/sys/sys/Makefile: tests/sys/sys/bitstring.c: Add tests for all existing and new functionality. include/bitstring.h Include all headers needed by sys/bitstring.h lib/libbluetooth/bluetooth.h: usr.sbin/bluetooth/hccontrol/le.c: Include bitstring.h instead of sys/bitstring.h. sbin/hastd/activemap.c: Correct usage of bitstr_size(). sys/dev/xen/blkback/blkback.c Use new bit_alloc. sys/kern/subr_unit.c: Remove hard-coded assumption that sizeof(bitstr_t) is 1. Get rid of unrb.busy, which caches the number of bits set in unrb.map. When INVARIANTS are disabled, nothing needs to know that information. callapse_unr can be adapted to use bit_ffs and bit_ffc instead. Eliminating unrb.busy saves memory, simplifies the code, and provides a slight speedup when INVARIANTS are disabled. sys/net/flowtable.c: Use the new kernel implementation of bit-alloc, instead of hacking the old libc-dependent macro. sys/sys/param.h Update __FreeBSD_version to indicate availability of new API Submitted by: gibbs, asomers Reviewed by: gibbs, ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6004
* Automate the subr_unit test.asomers2016-04-291-0/+10
| | | | | | | | | | | | | | | | | | | Build and install the subr_unit test program originally written by phk, and run it with the other ATF tests. tests/sys/kern/Makefile * Build and install the subr_unit test as a plain test sys/kern/subr_unit.c * Reduce the default number of repetitions from 100 to 1, and add a command-line parser to override it. * Don't be so noisy by default * Fix an include problem for the test build Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6038
* Fix issues identified by Coverityngie2016-04-191-51/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). - Remove intermediate variable for assigning from $TMPDIR if set in the environment to eliminate warnings about pointer conversions with "/tmp", and to mute an invalid buffer overflow concern from Coverity (snprintf and tacking on a NUL terminator was alleviating that concern before). - Remove useless self-test of psize before it's initialized. - Check the return values of getrlimit/setrlimit. Cosmetic changes: - Replace a `(void*)0` with NULL. - Do some minor whitespace clean up. - Remove an unnecessary cast to mmap. - Make all munmap calls use ATF_REQUIRE_MSG instead of using the: > if (munmap(..) == -1) > atf_tc_fail(..) idiom. Employ the new idiom consistently when calling munmap. CID: 1331351, 1331382-1331386, 1331513, 1331514, 1331565, 1331583, 1331694 Differential Revision: https://reviews.freebsd.org/D6012 MFC after: 2 weeks Reported by: Coverity Reviewed by: markj Sponsored by: EMC / Isilon Storage Division
* Fix leaks and test for getpagesize() returning == -1ngie2016-04-191-21/+35
| | | | | | | | | | | | | | - close file descriptors after use. - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). CID: 1331374-1331377, 1331653-1331662 Differential Revision: https://reviews.freebsd.org/D6011 MFC after: 2 weeks Reported by: Coverity Reviewed by: cem Sponsored by: EMC / Isilon Storage Division
* Minor cosmetic cleanupngie2016-04-181-2/+2
| | | | | | | | | - Remove spurious trailing whitespace in licensing header - Remove unnecessary semi-colon after comment [*] MFC after: 3 days Submitted by: pfg [*] Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-04-162-1/+61
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Add a test for cancelling an active AIO request on a socket.jhb2016-04-161-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | The older AIO code awakened all pending AIO requests on a socket when any data arrived. This could result in AIO daemons blocking on an empty socket buffer. These requests could not be cancelled which led to a deadlock during process exit. This test reproduces this case. The newer AIO code is able to cancel the pending AIO request correctly. Reviewed by: ngie (-ish) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D4363
| * Set test_argv to NULL, not 0, if not executing a specific testngie2016-04-151-1/+1
| | | | | | | | | | | | MFC after: 1 week Submitted by: pfg Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-04-042-6/+78
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Correct error messages in recently added test.jhb2016-03-311-4/+2
| | | | | | | | | | | | | | The large read test uses an empty file created via mkstemp() rather than /dev/null as character devices are subject to two different clamping sysctls. However, I forgot to update some of the error messages after changing to mkstemp() that were still referring to /dev/null.
| * Use a SKIP testplan instead of bailing out if/when the tester isn'tngie2016-03-221-6/+4
| | | | | | | | | | | | | | | | | | | | | | root, or the geom class can't be loaded cleanly [*] This makes sure that scenarios that are easy to hit aren't counted as false positives with kyua test MFC after: 1 week PR: 208101 Sponsored by: EMC / Isilon Storage Division
| * Fully handle size_t lengths in AIO requests.jhb2016-03-211-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, update the return types of aio_return() and aio_waitcomplete() to ssize_t. POSIX requires aio_return() to return a ssize_t so that it can represent all return values from read() and write(). aio_waitcomplete() should use ssize_t for the same reason. aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and system call entry were not updated. aio_waitcomplete() has always returned int. Note that this does not require new system call stubs as this is effectively only an API change in how the compiler interprets the return value. Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. aio_read/write should now honor the same length limits as normal read/write. Third, use longs instead of ints in the aio_return() and aio_waitcomplete() system call functions so that the 64-bit size_t in the in-kernel aiocb isn't truncated to 32-bits before being copied out to userland or being returned. Finally, a simple test has been added to verify the bounds checking on the maximum read size from a file.
* | MFHgjb2016-03-1046-0/+613
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-0946-0/+613
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-024-0/+83
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Refactor the AIO subsystem to permit file-type-specific handling andjhb2016-03-014-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | improve cancellation robustness. Introduce a new file operation, fo_aio_queue, which is responsible for queueing and completing an asynchronous I/O request for a given file. The AIO subystem now exports library of routines to manipulate AIO requests as well as the ability to run a handler function in the "default" pool of AIO daemons to service a request. A default implementation for file types which do not include an fo_aio_queue method queues requests to the "default" pool invoking the fo_read or fo_write methods as before. The AIO subsystem permits file types to install a private "cancel" routine when a request is queued to permit safe dequeueing and cleanup of cancelled requests. Sockets now use their own pool of AIO daemons and service per-socket requests in FIFO order. Socket requests will not block indefinitely permitting timely cancellation of all requests. Due to the now-tight coupling of the AIO subsystem with file types, the AIO subsystem is now a standard part of all kernels. The VFS_AIO kernel option and aio.ko module are gone. Many file types may block indefinitely in their fo_read or fo_write callbacks resulting in a hung AIO daemon. This can result in hung user processes (when processes attempt to cancel all outstanding requests during exit) or a hung system. To protect against this, AIO requests are only permitted for known "safe" files by default. AIO requests for all file types can be enabled by setting the new vfs.aio.enable_usafe sysctl to a non-zero value. The AIO tests have been updated to skip operations on unsafe file types if the sysctl is zero. Currently, AIO requests on sockets and raw disks are considered safe and are enabled by default. aio_mlock() is also enabled by default. Reviewed by: cem, jilles Discussed with: kib (earlier version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5289
* | MFHgjb2016-02-221-6/+8
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Ensure that we test the event condition when a disabled kevent is enabled.markj2016-02-191-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r274560 modified kqueue_register() to only test the event condition if the corresponding knote is not disabled. However, this check takes place before the EV_ENABLE flag is used to clear the KN_DISABLED flag on the knote, so enabling a previously-disabled kevent would not result in a notification for a triggered event. This change fixes the problem by testing for EV_ENABLED before possibly checking the event condition. This change also updates a kqueue regression test to exercise this case. PR: 206368 Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5307
OpenPOWER on IntegriCloud