OpenZFS/src d3af7c2module/os/freebsd/zfs zfs_vnops_os.c zfs_dir.c, module/os/linux/zfs zfs_dir.c zfs_vnops_os.c

Assert SA bulk array bounds before sa_bulk_update

The SA bulk arrays are filled by series of conditional SA_ADD_BULK_ATTR
calls whose worst-case count is easy to miscount, so a future attribute
add could silently overrun the fixed-size array.
Add ASSERT3S(count, <=, ARRAY_SIZE(bulk)) before each sa_bulk_update so
an overrun trips in debug builds, and use ARRAY_SIZE so the bound stays
tied to the declaration. Linux zfs_setattr allocates its arrays on the
heap sized by 'bulks', so it asserts against that instead.
Also tighten FreeBSD zfs_setattr's xattr_bulk from [7] to [6], its
actual worst case.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ameer Hamza <ahamza at ixsystems.com>
Closes #18573
DeltaFile
+4-1module/os/freebsd/zfs/zfs_vnops_os.c
+4-0module/os/linux/zfs/zfs_dir.c
+4-0module/os/linux/zfs/zfs_vnops_os.c
+4-0module/os/freebsd/zfs/zfs_dir.c
+3-0module/zfs/zfs_vnops.c
+1-0module/os/freebsd/zfs/zfs_acl.c
+20-14 files not shown
+24-110 files

OpenZFS/src 1d98dfemodule/os/linux/zfs zpl_file.c, tests/runfiles linux.run

Update mtime/ctime when fallocate grows a file

Growing a file with fallocate updated its size but left mtime/ctime
unchanged and didn't log the change. A fallocate that changes the file
size should update mtime/ctime, and the change should be logged so it
survives a crash.
Pass log=TRUE to zfs_freesp() on the extend path so it updates the
timestamps and logs the size change, matching zfs_space(). Punch-hole
and zero-range already use this path and are unaffected.

Reviewed-by: Rob Norris <rob.norris at truenas.com>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ameer Hamza <ahamza at ixsystems.com>
Closes #18573
DeltaFile
+77-0tests/zfs-tests/tests/functional/fallocate/fallocate_extend_timestamps.ksh
+6-1module/os/linux/zfs/zpl_file.c
+1-1tests/runfiles/linux.run
+1-0tests/zfs-tests/tests/Makefile.am
+85-24 files

OpenZFS/src d0b43eeinclude/sys zfs_znode.h, module/os/freebsd/zfs zfs_vnops_os.c zfs_znode_os.c

Persist z_seq across znode eviction

Commit 312bdab0f5 advertises STATX_ATTR_CHANGE_MONOTONIC and builds
the NFSv4 change_cookie from (ctime.tv_sec << 32) | zp->z_seq.
zp->z_seq is reset to a magic constant in zfs_znode_alloc(), so any
event that drops the znode from cache (memory pressure, remount,
reboot) regresses the lower bits of the cookie, a backward step
within the same second.

NFSv4 clients that trust this contract treat a regressed cookie as
evidence that the file's metadata cannot be relied on. VMware ESXi
over NFSv4.1 surfaces this as "The file specified is not a virtual
disk", and a VM stored on the affected NFS-exported ZFS dataset
fails to power on.

Widen z_seq to 64 bit and present it directly as the change_cookie,
dropping the ctime packing, so the cookie is a single monotonic
counter that no longer depends on the clock. FreeBSD's va_filerev
consumer also takes the wider value.

    [29 lines not shown]
DeltaFile
+36-34module/os/linux/zfs/zfs_vnops_os.c
+24-15module/os/freebsd/zfs/zfs_vnops_os.c
+25-11module/zfs/zfs_vnops.c
+32-4module/os/linux/zfs/zfs_znode_os.c
+28-3module/os/freebsd/zfs/zfs_znode_os.c
+26-1include/sys/zfs_znode.h
+171-6810 files not shown
+247-8616 files

OpenZFS/src 50d012bmodule/zfs zio.c

zbookmark_compare: handle "marker" bookmarks with negative levels

"Marker" bookmarks (those with zb_level == ZB_ROOT_LEVEL, ZB_ZIL_LEVEL
or ZB_DNODE_LEVEL) represent valid blocks, but are associated with a
dataset directly rather than with a specific object within it. They end
up on bookmark lists during scan prefetch, and so need to be sorted
ahead of any "true" object blocks.

The problem is that for negative levels, BP_SPANB produces a negative
shift, which is not legal C. Fortunately the results are used only for
comparison, so the worst possible behaviour in a forgiving compilation
environment is a mis-sort, which for the scan/traverse cases, means that
we haven't prefetched certain metadata before we actually need it. But
there _is_ UB in there, and UBSAN does rightly complain.

Here we fix all this by handling these bookmarks directly - sorting them
ahead of "true" object blocks, which is usually what scan/traverse will
prefer. And we don't do any interesting math on these bookmarks, so we
sidestep the whole UB thing.

    [6 lines not shown]
DeltaFile
+61-0module/zfs/zio.c
+61-01 files

OpenZFS/src e720a4ainclude zfs_crrd.h, module/zfs zfs_crrd.c

Constify some rrd_*() functions

These don't modify the db, so just constify them while we're in the
area.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
DeltaFile
+3-3include/zfs_crrd.h
+3-3module/zfs/zfs_crrd.c
+6-62 files

OpenZFS/src bc9ec31include zfs_crrd.h, module/zfs zfs_crrd.c

Add dbrrd_latest_time() to grab the latest timestamp in the db

Returns 0 if the database is empty, otherwise it returns the highest
value of the minutely db.  dbrrd_add() will already enforce the property
that these are monotonically increasing, so we won't try to second-guess
it.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
DeltaFile
+16-0module/zfs/zfs_crrd.c
+1-0include/zfs_crrd.h
+17-02 files

OpenZFS/src fff9a0fmodule/os/freebsd/zfs zfs_vfsops.c

freebsd: set mnt_time on the rootfs at mountroot time

FreeBSD's vfs_mountroot() will collect `mnt_time` from every filesystem
that we mounted and use the highest timestamp as a source for the system
time if we didn't get anything from an attached RTC.

Use the rrd mechanism added to gather up a notion of the latest time
and set it on mnt_time.  If the timestamp db is empty, we just fallback
to the uberblock timestamp and hope that that is in the right ballpark.

Relevant: FreeBSD PR254058[0] reporting the problem downstream

[0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254058

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
DeltaFile
+7-1module/os/freebsd/zfs/zfs_vfsops.c
+7-11 files

OpenZFS/src a174faemodule/zfs vdev_raidz_math_aarch64_neon_common.h

Fix aarch64 build failure by removing earlyclobber (#18532)

The UVR macros used "+&w" (read-write + earlyclobber) as the
constraint for NEON register operands that are declared as explicit
hard-register variables via:

register unsigned char wN asm("vN") __attribute__((vector_size(16)));

The + modifier implicitly makes the operand also an input (reading the
register before the asm runs). The & (earlyclobber) modifier says "this
output may be written before all inputs are consumed." Having an
earlyclobber output on the same hard-register that is simultaneously
an input is a contradiction — GCC 16 now strictly diagnoses this.

The fix removes the & from "+&w", yielding "+w". The earlyclobber
was both incorrect (contradicts the implicit input) and unnecessary
(the physical registers are already hard-bound, so the compiler has no
freedom to assign conflicting registers anyway).


    [7 lines not shown]
DeltaFile
+9-9module/zfs/vdev_raidz_math_aarch64_neon_common.h
+9-91 files

OpenZFS/src e2b97abtests/unit test_zap.c

unit/zap: uint64 keys

Add coverage for binary uint64-array keys (ZAP_FLAG_UINT64_KEY), the key
type used by the dedup table and block reference table.  Covers the
by-dnode operations on such a ZAP: add, lookup, length, lookup_length,
update and remove.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18639
DeltaFile
+71-0tests/unit/test_zap.c
+71-01 files

OpenZFS/src 6b8f798include/sys abd.h, module/zfs abd.c vdev_raidz.c

Avoid more abd_t allocations in RAIDZ/dRAID

RAIDZ/dRAID allocate rc_abdstruct for every column, but used it only
for data columns, while parity columns allocated additional abd_t's
on top of that.  This change introduces abd_alloc_linear_struct(),
abd_alloc_gang_struct() and abd_get_zeros_struct() to the ABD API,
mirroring the existing abd_get_offset_struct() pattern, and uses
them to use rc_abdstruct in remaining column cases.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18668
DeltaFile
+38-7module/zfs/abd.c
+12-9module/zfs/vdev_raidz.c
+6-4module/zfs/vdev_draid.c
+3-0include/sys/abd.h
+59-204 files

OpenZFS/src ca24d0atests/unit test_zap.c

unit/zap: add MT_MATCH_CASE mixed-case test

New case-normalization test to cover the exact-case path. On a TOUPPER
ZAP, MT_NORMALIZE | MT_MATCH_CASE matches only the stored casing, while
an MT_NORMALIZE lookup matches any case.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18638
DeltaFile
+42-0tests/unit/test_zap.c
+42-01 files

OpenZFS/src f16b374cmd/zstream zstream_dump.c zstream_recompress.c

zstream: refactor common functions

### Motivation

In the current version of `zstream`, each subcommand is independent and
is responsible for implementing its own stream-processing pipeline. It
started as a stream dumper, but as additional subcommands were added,
contributors typically copied an existing subcommand's pipeline and
adapted it for different purposes.

This pattern has led to quite a bit of duplicated code and has also led
to some functional nonuniformities. For example, some subcommands
support opposite-endian streams and others don't.

### Overview

This PR segregates functions that most subcommands need into
free-standing modules and reimplements the existing subcommands in
terms of those modules. The current modules are:

    [100 lines not shown]
DeltaFile
+416-656cmd/zstream/zstream_dump.c
+222-288cmd/zstream/zstream_recompress.c
+151-312cmd/zstream/zstream_redup.c
+462-0cmd/zstream/zstream_io.c
+127-265cmd/zstream/zstream_decompress.c
+93-232cmd/zstream/zstream_drop_record.c
+1,471-1,75386 files not shown
+4,941-2,08792 files

OpenZFS/src e3082b9module/os/freebsd/zfs zfs_vfsops.c

freebsd: set mnt_time on the rootfs at mountroot time

FreeBSD's vfs_mountroot() will collect `mnt_time` from every filesystem
that we mounted and use the highest timestamp as a source for the system
time if we didn't get anything from an attached RTC.

Use the rrd mechanism added to gather up a notion of the latest time
and set it on mnt_time.  If the timestamp db is empty, we just fallback
to the uberblock timestamp and hope that that is in the right ballpark.

Relevant: FreeBSD PR254058[0] reporting the problem downstream

[0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254058

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #18645
DeltaFile
+7-1module/os/freebsd/zfs/zfs_vfsops.c
+7-11 files

OpenZFS/src ee13f5ainclude zfs_crrd.h, module/zfs zfs_crrd.c

Add dbrrd_latest_time() to grab the latest timestamp in the db

Returns 0 if the database is empty, otherwise it returns the highest
value of the minutely db.  dbrrd_add() will already enforce the property
that these are monotonically increasing, so we won't try to second-guess
it.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #18645
DeltaFile
+16-0module/zfs/zfs_crrd.c
+1-0include/zfs_crrd.h
+17-02 files

OpenZFS/src 21fb393include zfs_crrd.h, module/zfs zfs_crrd.c

Constify some rrd_*() functions

These don't modify the db, so just constify them while we're in the
area.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #18645
DeltaFile
+3-3include/zfs_crrd.h
+3-3module/zfs/zfs_crrd.c
+6-62 files

OpenZFS/src 41311c6module/zfs vdev_raidz.c

RAIDZ: Optimize single data column writes

When a row contains only a single data column (one ashift-sized
block or 2-wide RAIDZ), P = Q = R = data mathematically.  In this
case point all parity column ABDs at the data column ABD, skipping
both buffer allocation and parity generation.

It might be not very efficient to write so small blocks on RAIDZ,
but it is allowed and does happen.  Skipping this allocation and
memory copy saves several percents of CPU time.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18695
DeltaFile
+33-1module/zfs/vdev_raidz.c
+33-11 files

OpenZFS/src 99ab859module/zfs metaslab.c

Optimize metaslab_set_selected_txg()

I don't think it makes much sense to choose for eviction between
metaslabs selected in the same TXG.  Considering that we also don't
evict them for at least 32 TXG, the difference should be in a noise.
Just skip the metaslab bumping if we already done it in this TXG.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18669
DeltaFile
+3-0module/zfs/metaslab.c
+3-01 files

OpenZFS/src 2ea519cmodule/os/freebsd/zfs zfs_dir.c zfs_znode_os.c

FreeBSD: avoid lookup overhead for nonexistent xattr directories

Port the z_xattr_dir_absent cache to FreeBSD.  As on Linux, a
getextattr that misses in the SA otherwise falls through to
zfs_get_xattrdir(), which takes the "" ZXATTR dirlock and reads
SA_ZPL_XATTR only to find the file has no xattr directory.  The
in-core znode now caches that: after an SA miss zfs_getextattr_impl()
skips the directory lookup when the flag is set, zfs_get_xattrdir()
sets it when no directory is found and clears it when one is found,
and zfs_make_xattrdir() clears it on creation, which also covers the
TX_MKXATTR ZIL replay path.

The flag is serialized by the base file's vnode lock.
zfs_make_xattrdir(), the only path that creates the directory and
clears the flag, runs with the vnode held exclusive, while every
reader that sets the flag holds it shared, so a set can never race
the clear.  ASSERT_VOP_ELOCKED() in zfs_make_xattrdir() and
ASSERT_VOP_LOCKED() in zfs_get_xattrdir() enforce this, both skipped
during ZIL replay since it is single threaded with no locked vnode.

    [8 lines not shown]
DeltaFile
+27-1module/os/freebsd/zfs/zfs_dir.c
+4-0module/os/freebsd/zfs/zfs_znode_os.c
+1-1module/os/freebsd/zfs/zfs_vnops_os.c
+32-23 files

OpenZFS/src 04092e8include/sys zfs_znode.h, module/os/linux/zfs zfs_dir.c zpl_xattr.c

Avoid lookup overhead for nonexistent xattr directories

A getxattr that misses in the file's SA falls through to
zfs_get_xattrdir(), which takes the "" ZXATTR dirlock and issues an
sa_lookup(SA_ZPL_XATTR), only to find the file has no xattr directory at
all. security.capability is the common trigger: the kernel probes it on
file access (get_vfs_caps_from_disk()), so for the many files that carry
no extended attributes the same fruitless lookup repeats constantly.
Profiling an SMB metadata workload showed roughly 6% of CPU spent in
zfs_get_xattrdir(), every call missing and returning ENOENT.

Cache the result in the in-core znode: a new boolean marks a file as
having no xattr directory. When it is set, a getxattr that misses in the
SA returns ENODATA from __zpl_xattr_get() without the zfs_lookup into
zfs_get_xattrdir, so neither the "" ZXATTR dirlock nor the SA_ZPL_XATTR
lookup runs. The flag is set when the directory lookup finds nothing and
cleared in zfs_make_xattrdir() whenever a directory is created, so the
setxattr and TX_MKXATTR ZIL replay paths are both covered. It is updated
under the existing z_xattr_lock and defaults to the real lookup, so

    [9 lines not shown]
DeltaFile
+16-0module/os/linux/zfs/zfs_dir.c
+6-0module/os/linux/zfs/zpl_xattr.c
+4-0module/os/linux/zfs/zfs_znode_os.c
+1-0module/os/linux/zfs/zfs_ctldir.c
+1-0include/sys/zfs_znode.h
+28-05 files

OpenZFS/src 520eeeamodule/zfs vdev.c

Improve performance of "zpool offline" for log devices

When offlining a log device, if it's part of a mirror that would still
be available after the offline operation, skip replaying the ZIL for
every dataset.  This drastically improves the performance of "zpool
offline" for one log device of a mirrored pair.

Sponsored by: ConnectWise
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alek Pinchuk <alek.pinchuk at connectwise.com>
Signed-off-by:  Alan Somers <asomers at gmail.com>
Closes #18664
DeltaFile
+8-5module/zfs/vdev.c
+8-51 files

OpenZFS/src 1fbd5e3tests/zfs-tests/tests/functional/events events_common.kshlib

honor file argument in file_wait_event

grep the log path passed by the caller instead of always using
ZED_DEBUG_LOG.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alek Pinchuk <Alek.Pinchuk at connectwise.com>
Closes #18700
DeltaFile
+1-1tests/zfs-tests/tests/functional/events/events_common.kshlib
+1-11 files

OpenZFS/src 97b9ba7cmd/zfs zfs_main.c, include zfs_deleg.h

delegate: add 'send:encrypted' permission

send:encrypted is like send:raw, but only permits encrypted datasets to
be sent - raw send is not permitted for unencrypted datasets.

This commit creates the permission, wires it up, and adds the check for
it in zfs_secpolicy_send_impl(), if it is the last send permission
standing, the dataset is checked for its encryption state.

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18673
DeltaFile
+10-3cmd/zfs/zfs_main.c
+11-0module/zfs/zfs_ioctl.c
+3-1man/man8/zfs-allow.8
+1-0include/zfs_deleg.h
+1-0module/zcommon/zfs_deleg.c
+1-0include/sys/dsl_deleg.h
+27-46 files

OpenZFS/src f0d69e6module/zfs zfs_ioctl.c

zfs_secpolicy_send: lift checks to common function for both

The permissions checks for send are a little involved because different
permissions grant different abilities, and there's two ways to initiate
a send.

This lifts the common permissions checks into a single function, and
ensures that we maintain a single dataset hold across all checks. This
will become important in the next commit when we need to check a
specific dataset property as part of the permission check.

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18673
DeltaFile
+52-13module/zfs/zfs_ioctl.c
+52-131 files

OpenZFS/src 166a667tests/zfs-tests/tests/functional/delegate zfs_allow_send.ksh

ZTS: delegate: test send:encrypted

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18673
DeltaFile
+12-0tests/zfs-tests/tests/functional/delegate/zfs_allow_send.ksh
+12-01 files

OpenZFS/src bce9a8etests/zfs-tests/tests/functional/delegate zfs_allow_send.ksh

ZTS: delegate: check send permissions on encrypted datasets

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18673
DeltaFile
+12-10tests/zfs-tests/tests/functional/delegate/zfs_allow_send.ksh
+12-101 files

OpenZFS/src 8303a36tests/zfs-tests/tests/functional/delegate delegate_common.kshlib

ZTS: delegate: add encryption option for test fixture datasets

The delegate test framework doesn't care about the encryption status of
the dataset under test, so by adding an option to create with encryption
the framework can be used to check encryption-related permissions
without any further fanfare.

Sponsored-by: TrueNAS
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18673
DeltaFile
+12-3tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
+12-31 files

OpenZFS/src b02c28e. README.md

README: update supported FreeBSD release to 15.1

Our CI runners moved to FreeBSD 15.1 in 0a4b59765 (#18667), but the
README still lists 15.0. Update it to match the CI version.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18696
DeltaFile
+1-1README.md
+1-11 files

OpenZFS/src 0483a8emodule/zfs vdev.c

Clean up embedded slog metaslab across txgs

On a read-write import, metaslab_set_fragmentation() can dirty a
metaslab via vdev_dirty() while still in the txg==0 load path when its
space map has an unexpected bonus size (e.g. a makefs-created pool
whose space-map dnodes use the boot loader's 24-byte space_map_phys_t
with nblkptr=3, giving db_size=64). If that metaslab is then selected
as the embedded slog, vdev_metaslab_init() only removed it from
vdev_ms_list when txg != 0, so the txg==0 case left it queued and
metaslab_fini() tripped VERIFY(!txg_list_member(&vd->vdev_ms_list,
msp, t)).

Remove slog_ms from the dirty list for every TXG_SIZE slot before
metaslab_fini() so the cleanup is correct regardless of txg.

Reported on FreeBSD as PR 281520:
External-issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281520

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>

    [2 lines not shown]
DeltaFile
+4-3module/zfs/vdev.c
+4-31 files

OpenZFS/src 14c2857contrib/initramfs/hooks zfs.in

initramfs-zfs should not try to copy directories

We had find only return files from the beginning for libgcc.so, but not
libfetch/libcurl. This oversight affected a user when vmware installed
its own libcurl.so.4 in a directory called libcurl.so.4, since our code
then tried to copy a directory, which fails.

Reviewed-by: Chris Longros <chris.longros at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Suggested-by: Carsten Härle <carsten.haerle at straightec.de>
Signed-off-by: Richard Yao <richard at ryao.dev>
Closes #18582
Closes #18686
DeltaFile
+1-1contrib/initramfs/hooks/zfs.in
+1-11 files

OpenZFS/src 562b96ctests/zfs-tests/tests/functional/cli_root/zfs_send_delegation zfs_send_test.ksh setup.ksh, tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user zfs_send_usertest.ksh setup.ksh

ZTS: remove send_delegation tests

These tests are doing the same tests as delegate/zfs_allow_send, and are
hard to follow and maintain. There's no need for them now, so drop them.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18672
DeltaFile
+0-150tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/zfs_send_usertest.ksh
+0-111tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/zfs_send_test.ksh
+0-50tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/setup.ksh
+0-50tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/setup.ksh
+0-43tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/cleanup.ksh
+0-43tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/cleanup.ksh
+0-4472 files not shown
+0-4618 files