FreeBSD/src d949721sys/contrib/openzfs/module/zfs zap.c zap_micro.c, sys/contrib/openzfs/tests/unit munit.c test_zap.c

zfs: merge openzfs/zfs at a170134fe

Notable upstream pull request merges:
 #18372 eaaea55b6 Consistently encode DRR_BEGIN packed nvlist payloads with
                  NV_ENCODE_XDR
 #18410 891e379d0 Fix failfast default and usage
 #18470 a2d053329 zdb: Add some more file layout output, triggered by -v
 #18472 d50f5b6d0 dsl_dir: avoid dd_lock during snapshots_changed updates
 #18493 d65015938 Vdev allocation bias/class change
 #18497 8fdc86675 zfs: annotate nested dd_lock in reservation sync
                  accounting
 #18494 956deba27 zdb: detect BRT and DDT leaks during block traversal
 #18499 c7cfe0805 zarcstat: detect attached L2ARC device with no data
 #18503 439b802e7 sa: fix sa_add_projid lock ordering
 #18508 968f4db03 zpool-attach.8: add EXAMPLES section
 #18513 45dddc452 zfs.4: Fix documentation of zfs_arc_dnode_reduce_percent
 #18516 8ff64005a zap: split implementation out into more files
 #18520 181e1b522 Fix double free for blocks cloned after DDT prune
 #18535 -multiple zstream: fix crashes when refcount tracking enabled

    [28 lines not shown]
DeltaFile
+1,119-1,529sys/contrib/openzfs/module/zfs/zap.c
+2,458-0sys/contrib/openzfs/tests/unit/munit.c
+15-1,608sys/contrib/openzfs/module/zfs/zap_micro.c
+1,458-0sys/contrib/openzfs/module/zfs/zap_fat.c
+1,170-0sys/contrib/openzfs/tests/unit/test_zap.c
+575-0sys/contrib/openzfs/tests/unit/munit.h
+6,795-3,137190 files not shown
+14,745-4,032196 files

FreeBSD/src 4a299efsys/dev/firewire firewire.c

firewire: clean up XXX comments

Remove stale and misleading XXX comments throughout firewire.c.
Most were from the original 2002 codebase and either described
correct behavior or noted aspirational improvements that never
happended.

Two actionable items retained as TODO: config ROM CRC validation
and pending xfer cleanup on detach.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57466
DeltaFile
+9-16sys/dev/firewire/firewire.c
+9-161 files

FreeBSD/src a620746sys/dev/firewire if_fwe.c

fix(fwe): add missing net epoch around ether_input

Wrap the if_input() call in fwe_as_input() with NET_EPOCH_ENTER/EXIT.
The network stack requires epoch protection when delivering packets
via if_input, and fwe was missing it.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57459
DeltaFile
+3-0sys/dev/firewire/if_fwe.c
+3-01 files

FreeBSD/src 390ae06sys/kern kern_procctl.c

procctl(PROC_REAP_GETPIDS): re-validate reaper after relock of proctree_lock

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57487
DeltaFile
+32-11sys/kern/kern_procctl.c
+32-111 files

FreeBSD/src 261c97bsys/kern kern_procctl.c

kern_procctl: add get_reaper_or_p() helper

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57487
DeltaFile
+10-6sys/kern/kern_procctl.c
+10-61 files

FreeBSD/src a845480sys/kern kern_procctl.c

procctl(): do not allow the process to exit inside kern_procctl_single()

Requested and reviewed by:      markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57491
DeltaFile
+15-21sys/kern/kern_procctl.c
+15-211 files

FreeBSD/src e5ef12clibexec/nuageinit nuageinit.7 nuageinit, libexec/nuageinit/tests nuageinit.sh

nuageinit: install certs in /usr/share/certs/trusted

Suggested by:   kevans
DeltaFile
+2-2libexec/nuageinit/tests/nuageinit.sh
+1-1libexec/nuageinit/nuageinit.7
+1-1libexec/nuageinit/nuageinit
+4-43 files

FreeBSD/src a170134man/man4 zfs.4, module/os/freebsd/zfs sysctl_os.c

metaslab: expose df_alloc_threshold and df_free_pct on Linux

Expose metaslab_df_alloc_threshold and metaslab_df_free_pct as module
parameters on Linux, matching their existing FreeBSD sysctls.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18632
DeltaFile
+0-26module/os/freebsd/zfs/sysctl_os.c
+12-0man/man4/zfs.4
+8-0module/zfs/metaslab.c
+20-263 files

FreeBSD/src b35bf7etests/zfs-tests/tests/functional/cli_root/zpool_import zpool_import_parallel_pos.ksh

ZTS: relax zpool_import_parallel_pos.ksh timing

Occasionally in the CI this test will fail because the parallel import
took longer than half of the serial time (but still less than the full
serial time).  Increase the cutoff to 3/4 of the serial time to preserve
the intent yet try and avoid these false positive failures.

Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #18634
DeltaFile
+2-2tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_parallel_pos.ksh
+2-21 files

FreeBSD/src 1ee4b5fsys/kern kern_fork.c

fork: Drop an uneeded PHOLD/PRELE pair

Support for swapping out kernel stacks was removed, so the PHOLD has no
purpose.  (And even before that, it's not clear why a swapout here would
have been problematic.)

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57486
DeltaFile
+0-9sys/kern/kern_fork.c
+0-91 files

FreeBSD/src 85195c0sys/netipsec ipsec_output.c

ipsec: Free entire mbuf chain on failure

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57475
DeltaFile
+1-1sys/netipsec/ipsec_output.c
+1-11 files

FreeBSD/src 232021fsys/compat/linuxkpi/common/src linux_80211.c

linuxkpi 802.11: Free entire mbuf chain on failure

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Fixes: 0936c648ad0ee ("LinuxKPI: 802.11: update the ni/lsta reference cycle")
Fixes: c816f64e66a0d ("LinuxKPI: 802.11: plug mbuf leak")
Differential Revision: https://reviews.freebsd.org/D57477
DeltaFile
+2-2sys/compat/linuxkpi/common/src/linux_80211.c
+2-21 files

FreeBSD/src 5a7f41esys/net if_stf.c

if_stf: Free entire mbuf chain on failure

Reported by:     Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    markj, bz, kp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57476
DeltaFile
+2-2sys/net/if_stf.c
+2-21 files

FreeBSD/src 8d9dff2. Makefile.inc1

check-old-libs: Show information about packages

If pkg is installed, for each old library found to still be present,
check if any installed packages either provide or require the library,
and inform the user.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D53977
DeltaFile
+9-0Makefile.inc1
+9-01 files

FreeBSD/src bad3c15libexec/nuageinit nuageinit.7

nuageinit: update documentation for phone_home and final_message
DeltaFile
+32-1libexec/nuageinit/nuageinit.7
+32-11 files

FreeBSD/src 68e60bblibexec/nuageinit nuage.lua

nuageinit: expose decode_base64 to fix tests
DeltaFile
+1-0libexec/nuageinit/nuage.lua
+1-01 files

FreeBSD/src 71e8122libexec/nuageinit nuage.lua, libexec/nuageinit/tests nuageinit.sh

nuage.lua: add encode_base64 helper
DeltaFile
+30-0libexec/nuageinit/nuage.lua
+20-0libexec/nuageinit/tests/nuageinit.sh
+50-02 files

FreeBSD/src d53633bsys/kern vfs_syscalls.c vfs_lookup.c, sys/sys vnode.h

rename(2): do not allow to rename root vnode of the mounted filesystem

Check for tdvp being vp_crossmp.  This cannot happen for the normal
rename cases, but could if the target path specified by the syscall
points to the nullfs mount over the regular file.  In this case namei()
cannot step over crossmp, and keep it in ni_dvp.

Since crossmp VOP_GETWRITEMOUNT() returns NULL mp, we retry the locking
dance since the belief is that NULL return is transient.

PR:     295826
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57453
DeltaFile
+9-0sys/kern/vfs_syscalls.c
+1-1sys/kern/vfs_lookup.c
+1-0sys/sys/vnode.h
+11-13 files

FreeBSD/src 5d0ebfesys/kern vfs_syscalls.c

renameat(2): when retrying, check for pending signals

The vn_start_write() call there is already interruptible.  Check for
user signals before restarting due to ERELOOKUP, or after failed
vn_start_write().  Note that vn_start_write(V_XSLEEP | V_PCATCH)
does not check for signals if not sleeping.

PR:     295826
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57453
DeltaFile
+8-2sys/kern/vfs_syscalls.c
+8-21 files

FreeBSD/src 9263fb9sys/conf newvers.sh

15.1: Update to RC2

Approved by:    re (implicit)
Sponsored by;   OpenSats Initiative
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 56e5998stand/efi/loader bootinfo.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader.efi: Fix when staging moves late

Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,

    [21 lines not shown]
DeltaFile
+34-24stand/efi/loader/arch/i386/elf64_freebsd.c
+30-21stand/efi/loader/arch/amd64/elf64_freebsd.c
+17-1stand/efi/loader/bootinfo.c
+81-463 files

FreeBSD/src dd2e9aausr.sbin/bsdinstall/scripts script

bsdinstall: script: Fix scripted DISTRIBUTIONS

Restore exporting DISTRIBUTIONS to make it available to other scripts.

Approved by:    re (cperciva)
Reviewed by:    imp, asomers
Fixes:          dc14ae4217a0 ("bsdinstall: do pkgbase installations with the "script" command")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57319

(cherry picked from commit 283959bbe0863917c4fc3200a92d1055a4c89bdc)
(cherry picked from commit 0e3c9cbee4ac735b7c19f3cb719b65f960be0b23)
DeltaFile
+1-0usr.sbin/bsdinstall/scripts/script
+1-01 files

FreeBSD/src 95632c9stand/efi/loader bootinfo.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader.efi: Fix when staging moves late

Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,

    [19 lines not shown]
DeltaFile
+34-24stand/efi/loader/arch/i386/elf64_freebsd.c
+30-21stand/efi/loader/arch/amd64/elf64_freebsd.c
+17-1stand/efi/loader/bootinfo.c
+81-463 files

FreeBSD/src 3915ffbstand/efi/loader bootinfo.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader.efi: Fix when staging moves late

Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,

    [17 lines not shown]
DeltaFile
+34-24stand/efi/loader/arch/i386/elf64_freebsd.c
+30-21stand/efi/loader/arch/amd64/elf64_freebsd.c
+17-1stand/efi/loader/bootinfo.c
+81-463 files

FreeBSD/src 16e5abfsys/dev/acpica acpi_apei.c

APEI: Provide more info on fatal hardware errors

This change refactors fatal error delivery via APEI and prints more info:

- Makes the NMI handler call into the ge handler to establish a common
        code flow, no matter how the error is delivered
- Adds the FRU to the panic string so as to provide more information than
        just "APEI Fatal Hardware Error!" such as
        "APEI Fatal Hardware Error: PcieError"
- Prints more details about fatal pcie errors.  Note that we skip acquiring
        Giant on fatal errors
- Hexdumps the full GED data on fatal errors, so as to facilitate
        offline data analysis

Reviewed by: imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D57417
DeltaFile
+37-16sys/dev/acpica/acpi_apei.c
+37-161 files

FreeBSD/src e27261dsys/x86/x86 ucode.c

amd64: there is no reason to copy ucode around in ucode_load_bsp()

Approved by:    re (cperciva)
PR:     294630

(cherry picked from commit 16f21c5af35002b8361ffb2e83ff3c92cd899a3a)
(cherry picked from commit c6ccef4a32b4e09927dfdcc0f734af25c6193f5a)
DeltaFile
+9-11sys/x86/x86/ucode.c
+9-111 files

FreeBSD/src 77e894csys/security/audit audit_trigger.c

audit: Replace TAILQ with STAILQ

This reduces the size of a trigger entry from 24 bytes to 16 (or from
12 bytes to 8 on 32-bit) with no additional complexity.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, emaste
Differential Revision:  https://reviews.freebsd.org/D57464
DeltaFile
+11-11sys/security/audit/audit_trigger.c
+11-111 files

FreeBSD/src 0620c99sys/security/audit audit_trigger.c

audit: Add poll / select support

It was previously not possible to poll() or select() on the trigger
device, which made implementing proper signal handling in auditd
difficult.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D57457
DeltaFile
+21-2sys/security/audit/audit_trigger.c
+21-21 files

FreeBSD/src 520e0f5sys/netinet6 udp6_usrreq.c

udp: Fix resource leaks in an error path in udp6_send()

Reported by:    Andrew Griffiths <andrew at calif.io>
Fixes:          069a67374ed9 ("ip6: Remove support for RFC2675 (Jumbo Payload Option)")
Reviewed by:    pouria, tuexen, glebius
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57341
DeltaFile
+2-4sys/netinet6/udp6_usrreq.c
+2-41 files

FreeBSD/src 58653bflibexec/nuageinit nuageinit, libexec/nuageinit/tests nuageinit.sh

nuageinit: implement phone_home support

Posts instance data (hostname, instance_id, public keys) to a URL
using fetch(1). Supports:
- url: target URL
- post: list of data items to send, or 'all'
- tries: number of retry attempts (default 1)
DeltaFile
+89-2libexec/nuageinit/nuageinit
+33-0libexec/nuageinit/tests/nuageinit.sh
+122-22 files