aboutsummaryrefslogtreecommitdiff
path: root/cddl
Commit message (Collapse)AuthorAgeFilesLines
* libzpool: add workaround for MIPS-specific llvm bug compiling arc.cDimitry Andric2024-12-011-0/+8
| | | | | | | | | | | This works around an assertion in llvm's shrink wrapping analysis pass, when compiling arc.c for mips and mips64: Assertion failed: (PhysReg.isPhysical() && "Unallocated register?!"), function useOrDefCSROrFI, file /usr/src/contrib/llvm-project/llvm/lib/CodeGen/ShrinkWrap.cpp, line 341. The bug will also be submitted upstream. Direct commit to stable/13, since MIPS support was removed in 14.0.
* zfs: merge openzfs/zfs@fb6d53206 (zfs-2.1-release) into stable/13Martin Matuska2024-03-013-2/+23
| | | | | | | | | | | | | | | | | Notable upstream pull request merges: #13976 3ad882658 Avoid calling rw_destroy() on uninitialized rwlock #15243 11574a793 Add zfs_prepare_disk script for disk firmware install #15331 e1bc32f71 Report ashift of L2ARC devices in zdb #15675 12a031a3f spa: make read/write queues configurable #15719 b4481996b spa: Fix FreeBSD sysctl handlers #15719 8e5298f0a spa: Let spa_taskq_param_get()'s addition of a newline be optional #15769 dfece78a4 Add 'zpool status -e' flag to see unhealthy vdevs #15847 d1ee3d611 LUA: Backport CVE-2020-24370's patch Obtained from: OpenZFS OpenZFS commit: fb6d532066f23458f768a97ae94b158c42cbe484 OpenZFS tag: zfs-2.1.15
* zfsd: fault disks that generate too many I/O delay eventsAlan Somers2024-01-193-4/+88
| | | | | | | | | | | | | If ZFS reports that a disk had at least 8 I/O operations over 60s that were each delayed by at least 30s (implying a queue depth > 4 or I/O aggregation, obviously), fault that disk. Disks that respond this slowly can degrade the entire system's performance. Sponsored by: Axcient Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D42825 (cherry picked from commit d565784a7ebaa59e26febdcfd4a60329786ea5f5)
* dtrace: fix constants used by the siftr probeMichael Tuexen2024-01-111-2/+2
| | | | | | | | | | | | The constants used in the C code were changed in https://svnweb.freebsd.org/changeset/base/343646 but changing them also in the dtrace translator was missed. Reviewed by: cc, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40805 (cherry picked from commit f5541b85a592da9e1e1723b190f1e08afd7d5b18)
* ctfconvert: Handle DW_AT_data_bit_offsetMark Johnston2024-01-091-1/+3
| | | | | | | | | | | This attribute is new in DWARF 4 and supersedes DW_AT_bit_offset. PR: 276059 Reported by: rscheff Tested by: rscheff MFC after: 1 week (cherry picked from commit 78cd75393ec79565c63927bf200f06f839a1dc05)
* libdtrace: Fix TCP data offset handling in the tcpinfo_t translatorMark Johnston2024-01-091-2/+2
| | | | | | | | | | | | The header gives an offset in 32-bit words, and the translator is supposed to convert that to a byte count. But, the conversion was incorrect. Reviewed by: tuexen, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43264 (cherry picked from commit c3268c23de45b75b44102a02e96f44b0ff2f6ba7)
* libdtrace: Fix line number reporting in error messagesMark Johnston2024-01-071-0/+2
| | | | | | MFC after: 1 week (cherry picked from commit ad3174ecea3374442b3504149fe2b5a9d9ec6f1e)
* Trim various $FreeBSD$John Baldwin2023-10-243-5/+0
| | | | | | | | Approved by: markj (cddl/contrib changes) Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41961 (cherry picked from commit f53355131f65d64e7643d734dbcd4fb2a5de20ed)
* Fix zfsd with the device_removal pool feature.Alan Somers2023-09-212-4/+38
| | | | | | | | | | | | | | | | | | | Previously zfsd would crash in the presence of a pool with a top-level-vdev that had previously been removed. The crash happened because the configuration nvlist of such a TLV contains an empty ZPOOL_CONFIG_CHILDREN array, which led to a pop_front from an empty list, which has undefined behavior. The crash only happened in stable/14 and later, probably do to differences in libcxx, but the change should be MFCed anyway. PR: 273663 Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> Sponsored by: Axcient Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D41818 (cherry picked from commit 0b294a386d34f6584848ed52407687df7ae59861)
* zfsd: listen for sysevent.fs.zfs instead of misc.fs.zfsAlan Somers2023-09-064-12/+12
| | | | | | | | | | | | | | | | | | | | | At some point the names of these devd events changed. Probably it happened when importing OpenZFS. Before that, FreeBSD's sysevent_alloc method didn't create a "class" nvpair in the event, which led to log_sysevent using the event's ev_subclass field as its type. Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D39437 (cherry picked from commit 92642bba4db4bf1719758ac7233468bc09a0bd59) Fix zfsd unittests after 92642bba4db At the time we ensured that the more important functional tests were working, but neglected to update the unit tests. Sponsored by: Axcient (cherry picked from commit 2a0c0aea42092f89c2a5345991e6e3ce4cbef99a)
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-236-12/+0
| | | | | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit fa9896e082a1)
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-23289-290/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-237-18/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-234-4/+0
| | | | | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/ Similar commit in main: (cherry picked from commit 2a63c3be1582)
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit 42b388439bd3)
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-2346-92/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* ctfconvert: Integer encoding types are unsignedMark Johnston2023-07-051-3/+3
| | | | | | | | | | Before this change, encodings in the user-defined range were being sign-extended. MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 258a0d760aa8b42899a000e30f610f900a402556)
* dtrace: add register bindings for RISC-VChristos Margiolis2023-05-072-0/+75
| | | | | | | | | Reviewed by: mhorne, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39611 (cherry picked from commit 1fef7abdc76bd6f0c93775bd0c1b62b523abd20d)
* dtrace: expose dtrace_instr_size() to userland and implement it for riscvChristos Margiolis2023-05-071-1/+5
| | | | | | | | | | | | dtrace_instr_size() is needed by the forthcoming RISC-V port of kinst, as well as by libdtrace in D38825 for both amd64 and RISC-V. Reviewed by: markj, mhorne MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39489 (cherry picked from commit 080e56a6c98c7e7a241a4260d4c19d3cad5b22af)
* libdtrace: Do not set SHF_ALLOC on SUNW_dof relocation sectionsMark Johnston2023-04-111-2/+2
| | | | | | | | | | | | | | | The section will contain static relocations which do not need to be preserved after linking, and moreover these relocations may reference symbols that end up getting removed. Do not set SHF_ALLOC and instead let the linker decide what needs to be done. PR: 258872 MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 27f35b7dd418a82cf2f5bb618bd4bb7e81253f3a)
* libdtrace: fix indendation in dt_printd()Christos Margiolis2023-03-271-1/+1
| | | | | | | | | | No functional change. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39145 (cherry picked from commit 3afba490c1266200e9fd899f2494aa47f71c6095)
* dwatch: install hard links with same mode as targetEd Maste2023-03-231-0/+1
| | | | | | | | | | | | Previoulsy when using NO_ROOT we recorded METALOG entries for dwatch hard links with different file modes than their link targets, which is not permitted. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37477 (cherry picked from commit 7543a9c0280a0f4262489671936a6e03b9b2c563)
* libicp: Link with -z noexecstack for ld.bfd.John Baldwin2023-03-222-0/+4
| | | | | | | The assembly source files do not contain GNU-stack annotations, so ld.bfd defaults to using an executable stack. (cherry picked from commit 7e3e70ce214d042e202828b0665904840928a002)
* lockstat: Use gelf.h instead of playing games with the preprocessorMark Johnston2023-03-051-13/+8
| | | | | | | | | This reverts a portion of 1477dd823ee ("Merge OpenZFS support in to HEAD."). No functional change intended. MFC after: 1 week (cherry picked from commit 49e3972afc1112f95863a04cea7a4401b78dfd1f)
* lockstat: Use the correct type for a symbol sizeMark Johnston2023-03-051-1/+1
| | | | | | | | No functional change intended. MFC after: 1 week (cherry picked from commit f4f5e69c84df74e8834aed173af1127b1ff50970)
* Delete obsolete Solaris compat header file stdlib.hZhenlei Huang2023-03-021-37/+0
| | | | | | | | | | | | | | | | | | | | | | This drops function `getexecname()` redirection. Historically `getexecname()` is a compatibility definition. Since openzfs has its own implementation of function `getexecname()` in libspl and has been merged into base, the compat header file stdlib.h is no longer needed and should not be used. Also without this fix libspl will end up an incompatible version of `getprogname()` with libc. In particular, if zfs is enabled, programs such as pgrep in /rescue can be wrongly statically linked with libspl and will not function properly. PR: 269738 Reviewed by: markj Fixes: 9e5787d2284e Merge OpenZFS support in to HEAD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38733 (cherry picked from commit 7f0ebf0876c82a098bd5815ea6bf3a8efa6dd6f3)
* ctf: Remove unused function prototype for getpname()Zhenlei Huang2023-02-271-2/+0
| | | | | | | | | | This function prototype should have been removed along with the implementation. Fixes: 3dd552426409 ctfdump: Use getprogname() MFC after: 1 day (cherry picked from commit f8e1aa85fed08d5f689cb36d65a76d191f6500dd)
* ctfdump: Use getprogname()Zhenlei Huang2023-02-262-25/+1
| | | | | | | | | | Also remove no longer used function `getpname()`. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38740 (cherry picked from commit 3dd5524264095ed8612c28908e13f80668eff2f9)
* pkgbase: Put zfs utilities and lib in their own packageEmmanuel Vadot2023-02-0222-14/+23
| | | | | | | | | | | It is useful to have zfs utilities and lib in a separate package as it allow users to create image that can support ZFS (i.e. not with WITHOUT_ZFS in src.conf set) without bloating the default image with all zfs tools (for example for jails). Differential Revision: https://reviews.freebsd.org/D36225 (cherry picked from commit a71ea7bea0d2a8ba86373377c3c1443acbeab5d2)
* libdtrace: Change the binding of USDT probe symbols to STB_WEAKMark Johnston2022-12-191-0/+1
| | | | | | | | | | | | | | | | | | Otherwise, if multiple object files contain references to the same probe, newish lld will refuse to link them by default, raising a duplicate global symbol definition error. Previously, duplicate global symbols with identical absolute st_values were permitted by both lld and GNU ld. Since dtrace has no use for probe function symbols after the relocation performed by dtrace -G, make the symbols weak as well, following a suggestion from MaskRay. Reported by: dim MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit be39466a1035ffb13268cd63723e976898e9b91e)
* zfsd(8): Fix a typo in an error messageGordon Bergling2022-11-011-1/+1
| | | | | | - s/faild/failed/ (cherry picked from commit 4bd5e6221ed11ba6e584eae9e511bd8a1c18031c)
* libdtrace: Fix some CPU register number definitions to match the kernelMark Johnston2022-10-191-3/+3
| | | | (cherry picked from commit 53a31c87df9f0f77d26a5d35cb8322c8e78033ce)
* dtrace: Add a "regs" variableMark Johnston2022-10-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This allows invop-based providers (i.e., fbt and kinst) to expose the register file of the CPU at the point where the probe fired. It does not work for SDT providers because their probes are implemented as plain function calls and so don't save registers. It's not clear what semantics "regs" should have for them anyway. This is akin to "uregs", which nominally provides access to the userspace registers. In fact, DIF already had a DIF_VAR_REGS variable defined, it was simply unimplemented. Usage example: print the contents of %rdi upon each call to amd64_syscall(): fbt::amd64_syscall:entry {printf("%x", regs[R_RDI]);} Note that the R_* constants are defined in /usr/lib/dtrace/regs_x86.d. Currently there are no similar definitions for non-x86 platforms. Reviewed by: christos (cherry picked from commit bdd101c4d4aeab6c9e76250c310c16f5704b8b8c)
* zfs: merge openzfs/zfs@6a6bd4939 (zfs-2.1-release) into stable/13Martin Matuska2022-10-042-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenZFS release 2.1.6 Notable upstream pull requeset merges: #11733 ICP: Add missing stack frame info to SHA asm files #12274 Optimize txg_kick() process #12284 Add Module Parameter Regarding Log Size Limit #12285 Introduce a tunable to exclude special class buffers from L2ARC #12287 Remove refcount from spa_config_*() #12425 Avoid small buffer copying on write #12516 Fix NFS and large reads on older kernels #12678 spa.c: Replace VERIFY(nvlist_*(...) == 0) with fnvlist_* #12789 Improve log spacemap load time #13022 Add more control/visibility and speedup spa_load_verify() #13106 add physical device size to SIZE column in 'zpool list -v' #13388 Improve mg_aliquot math #13405 Revert "Reduce dbuf_find() lock contention" #13452 More speculative prefetcher improvements #13476 Refactor Log Size Limit #13540 AVL: Remove obsolete branching optimizations #13553 Reduce ZIO io_lock contention on sorted scrub #13555 Scrub mirror children without BPs #13563 FreeBSD: Improve crypto_dispatch() handling #13576 Several sorted scrub optimizations #13579 Fix and disable blocks statistics during scrub #13582 Several B-tree optimizations #13591 Avoid two 64-bit divisions per scanned block #13606 Avoid memory copies during mirror scrub #13613 Avoid memory copy when verifying raidz/draid parity #13643 Fix scrub resume from newly created hole #13756 FreeBSD: Mark ZFS_MODULE_PARAM_CALL as MPSAFE #13767 arcstat: fix -p option #13781 Importing from cachefile can trip assertion #13794 Apply arc_shrink_shift to ARC above arc_c_min #13798 Improve too large physical ashift handling #13811 Fix column width in 'zpool iostat -v' and 'zpool list -v' #13842 make DMU_OT_IS_METADATA and DMU_OT_IS_ENCRYPTED return B_TRUE or B_FALSE #13855 zfs recv hangs if max recordsize is less than received recordsize #13861 Fix use-after-free in btree code #13865 vdev_draid_lookup_map() should not iterate outside draid_maps #13878 Delay ZFS_PROP_SHARESMB property to handle it for encrypted raw receive #13882 FreeBSD: Fix integer conversion for vnlru_free{,_vfsops}() #13885 Fix incorrect size given to bqueue_enqueue() call in dmu_redact.c #13908 FreeBSD: stop passing LK_INTERLOCK to VOP_LOCK #13930 zpool: Don't print "repairing" on force faulted drives #13954 Fix bad free in skein code Obtained from: OpenZFS OpenZFS tag: zfs-2.1.6 OpenZFS commit: 6a6bd493988c75331deab06e5352a9bed035a87d Relnotes: yes
* ctfconvert: Give bitfield types names distinct from the base typeMark Johnston2022-08-113-3/+19
| | | | | | | | | | | | | | | | | | | CTF integers have an explicit width and so can be used to represent bitfields. Bitfield types emitted by ctfconvert(1) share the name of the base integer type, so a struct field with type "unsigned int : 15" will have a type named "unsigned int". To avoid ambiguity when looking up types by name, add a suffix to names of bitfield types to distinguish them from the base type. Then, if ctfmerge happens to order bitfield types before the corresponding base type in a CTF file, a name lookup will return the base type, which is always going to be the desired behaviour. PR: 265403 Reported by: cy Sponsored by: The FreeBSD Foundation (cherry picked from commit 1165fc9a526630487a1feb63daef65c5aee1a583)
* dtrace tests: Override RLIMIT_CORE for a test which triggers a core dumpMark Johnston2022-08-111-1/+1
| | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit e1700a36a9471a623c89f3112d69234ee6ac7fae)
* dtrace tests: Rename some test type names to avoid a conflictMark Johnston2022-08-111-6/+6
| | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit 6a05f1438145c2d8c3d0e29e1d5e24a05d394453)
* lockstat: Fix construction of comparision predicatesKornel Dulęba2022-07-191-2/+2
| | | | | | | | | | | | | | | | Passing "0x%p" to sprintf results in double "0x" being printed. This causes a dtrace script compilation failure when "-d" flag is specified. Fix that by removing the extraneous "0x". Reviewed by: markj Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Alstom MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35690 (cherry picked from commit 9dbacce2d48abf04b4d65d2994586e1ff44b08fb)
* ctfdump: Remove definitions of warn() and vwarn()Mark Johnston2022-04-283-31/+2
| | | | | | | | | | | | The presence of the latter causes a link error when building a statically linked ctfdump(1) because libc defines the same symbol. libc's warn() is defined as a weak symbol and so does not cause the same problem, but let's just use libc's version. Reported by: stephane rochoy <stephane.rochoy@stormshield.eu> Sponsored by: The FreeBSD Foundation (cherry picked from commit 45dd2eaac379e5576f745380260470204c49beac)
* ctf: Link CTF toolchain man pages to ctf.5Mark Johnston2022-04-283-12/+16
| | | | | | | | | Also expand the CTF acronym to provide a bit of context. PR: 259790 Sponsored by: The FreeBSD Foundation (cherry picked from commit 5727eceabc93e218f0dd369a66d06d619e7fa080)
* libctf: Fix recursive descent into anonymous SOU fieldsMark Johnston2022-04-141-2/+2
| | | | | | | | | PR: 262412 Tested by: dhw, gallatin Fixes: a6fb86917362 ("libctf: Handle CTFv3 containers") Sponsored by: The FreeBSD Foundation (cherry picked from commit 6e563a1b608438504d963c2d7c70e50d2e75af46)
* ctf: Avoid passing a caddr_t to roundup2()Mark Johnston2022-04-071-1/+1
| | | | | | | | | For some reason I can't reproduce this locally, but Jenkins complains. Reported by: Jenkins Fixes: bdf290cd3e1a ("ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}") (cherry picked from commit 3fe1f21fb364e38f2bf7e7100dad59b067b27080)
* ctf: Fix a -Wunused-but-set-variable warningMark Johnston2022-04-071-2/+0
| | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit cb6f7225629301d3179f6e9f6d3be4d80f57a31f)
* ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}Mark Johnston2022-04-073-271/+472
| | | | | | | | | ctfdump handles v2 and v3. ctfconvert now emits only CTFv3, whereas ctfmerge can merge v2 and v3 containers into v3 containers. Sponsored by: The FreeBSD Foundation (cherry picked from commit bdf290cd3e1a69d41c2f8bb60bd415cfa78adba2)
* libctf: Handle CTFv3 containersMark Johnston2022-04-078-421/+895
| | | | | | | | | | | | | | | In general, the patch adds indirection to minimize the amount of code that needs to know about differences between v2 and v3. Specifically, some new ctf_get_ctt_* functions are added, and new LCTF_* macros are added to use the underlying container's version to do the right thing. CTF containers can have parent/child relationships, wherein a type ID in one container refers to a type in the parent. It is permitted for the parent and child to have different versions. Sponsored by: The FreeBSD Foundation (cherry picked from commit a6fb86917362e3f6d24e95e940e80845c2cfde8a)
* ctf: Add definitions for CTFv3Mark Johnston2022-04-071-94/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | These are based on definitions added to binutils' libctf. Specifically: - Type IDs are now encoded in 32 bits rather than 16, changing the layout of ctf_type_t, ctf_array_t, ctf_member_t and ctf_lmember_t. - Type info is encoded in 32 bits rather than 16. The type "kind" is extended from 5 bits to 6, and the type "vlen" is extended from 10 bits to 25. The main upside is that we remove the current limit, imposed by CTFv2, of 2^{15} distinct types in the main kernel executable. Other limits, such as that on the number of elements in an enum, imposed by the vlen limit, are also raised. This change adds v2 and v3 flavours of macros and type definitions which differ between the two versions. Compatibility is preserved for now by having generic names refer to the v2 definitions, so, e.g., ctf_type_t is still a v2 type. No functional change intended. Reviewed by: Domagoj Stolfa Sponsored by: The FreeBSD Foundation (cherry picked from commit 994297b01b98816bea1abf45ae4bac1bc69ee7a0)
* ctf: Import ctf.h from OpenBSDMark Johnston2022-04-072-2/+1
| | | | | | | | | | | | | | | | | Use it instead of the existing ctf.h from OpenSolaris. This makes it easier to use CTF in the core kernel, and to extend the CTF format to support wider type IDs. The imported ctf.h is modified to depend only on _types.h, and also to provide macros which use the "parent" bit of a type ID to refer to types in a parent CTF container. No functional change intended. Reviewed by: Domagoj Stolfa, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit 2d5d2a986ce1a93b8567dbdf3f80bc2b545d6998)
* dtrace tests: Fix expected outout for tst.system.dLi-Wen Hsu2022-03-091-6/+6
| | | | | | | | | This is follow up of d500a85e640d1cd270747c12e17c511b53864436 PR: 262415 Sponsored by: The FreeBSD Foundation (cherry picked from commit 16e02ae401ebd9aa7d47f46dc4905f4f8add70a8)
* libctf: Use const ctf_file_t references in string lookup routinesMark Johnston2022-03-022-5/+5
| | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit 45c23c2608ec3e34b5c7ce18eca91a46419e363c)
* libctf: Remove checks for CTFv1Mark Johnston2022-03-022-13/+8
| | | | | | | | | Per commit 7db423d69273 ("libctf: Rip out CTFv1 support") this support is obsolete. Sponsored by: The FreeBSD Foundation (cherry picked from commit 565518046c9e721ea6ff608d44f1e89d344e5e02)