OpenZFS/src fc15a2f — lib/libzfs libzfs_pool.c

libzfs: honor literal for vdev fragmentation property

"zpool get -p fragmentation <pool> all-vdevs" printed the value with
a trailing '%', unlike the pool fragmentation property and the vdev
capacity property.  Print the bare number when literal is requested.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: George Melikov <mail at gmelikov.ru>
Closes #19222
DeltaFile
+3-0lib/libzfs/libzfs_pool.c
+3-01 files

OpenZFS/src 79a65e3 — module/zfs vdev.c

vdev_prop_get: report real vdev fragmentation

VDEV_PROP_FRAGMENTATION was taken from vd->vdev_stat.vs_fragmentation,
which is never updated: fragmentation is only filled into the copy
returned by vdev_get_stats_ex().  So "zpool get fragmentation <pool>
all-vdevs" always reported 0%.

Report the same values as "zpool list -v": pool fragmentation for the
root vdev, metaslab group fragmentation for top-level concrete vdevs,
and "-" for everything else.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: George Melikov <mail at gmelikov.ru>
Closes #16459
Closes #19222
DeltaFile
+16-2module/zfs/vdev.c
+16-21 files

OpenZFS/src f1f96f5 — module/zfs dbuf.c

dbuf: restore BP_IS_HOLE() recheck after dnode_block_freed()

Commit 79cf54582 ("Fix reads for blocks freed after being cloned")
reworked the level-0 check in dbuf_read_hole() and dropped the
BP_IS_HOLE() recheck that followed dnode_block_freed(), together with
the comment explaining it.  That recheck was not about overrides: it
closes a race with dnode_sync().

dnode_sync_free_ranges() drops dn_mtx, clears the bps through
dnode_sync_free_range_impl() -> free_blocks(), then retakes dn_mtx and
removes the range from dn_free_ranges.  For blkptrs held in the dnode
(dn_nlevels == 1), free_blocks() writes the bp without the parent's
db_rwlock, so holding that lock in dbuf_read() does not serialize
against it.  A reader that saw a non-hole bp, then waited on dn_mtx in
dnode_block_freed() until the range was removed, gets "not freed" while
the bp it is about to copy is already a hole (with HOLE_BIRTH, lsize
and birth preserved).  dbuf_read_impl() then hands that hole to
arc_read(): no child I/O is issued, checksum verification fails with
EINVAL, and without ZIO_FLAG_CANFAIL the pool is suspended.

    [19 lines not shown]
DeltaFile
+9-1module/zfs/dbuf.c
+9-11 files

OpenZFS/src 88da095 — module/zfs zvol.c spa_misc.c, tests/runfiles common.run

Fix a deadlock between zvol first open and pool export

After the reference check, zpool export drops the namespace lock with
spa_export_thread still set, and then removes the pool's zvols. A zvol
first open can take the namespace lock in that window. It then waits in
spa_lookup() for the export to finish while it holds zv_state_lock.
Export needs that lock to remove the zvol, so neither can make progress.

zvol_first_open() now fails with ENXIO when spa_lookup() would wait for
the pool. That is the same error the open gets a moment later, once
export marks the zvol for removal. An open in that window can never
succeed, because export removes the zvol before anything else can fail.
So only the case that hangs today behaves differently.

The check is in the shared zvol_first_open(), so it covers Linux,
FreeBSD, and opens made while the caller already holds the namespace
lock, such as a pool that uses zvols from another pool as vdevs. The
new spa_lookup_would_wait() shares its code with spa_lookup().


    [10 lines not shown]
DeltaFile
+82-0tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_zvol_open_pos.ksh
+26-3module/zfs/spa_misc.c
+9-0module/zfs/zvol.c
+1-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+1-0tests/zfs-tests/include/tunables.cfg
+120-41 files not shown
+121-47 files

OpenZFS/src fccf7b4 — include/sys zfs_file.h, lib/libzpool zfs_file_os.c

zfs_file: hide implementing struct

Nothing cares about what zfs_file_t actually is, so we can remove it
from the public header and with it the platform gates.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19231
DeltaFile
+32-17lib/libzpool/zfs_file_os.c
+29-19module/os/freebsd/zfs/zfs_file_os.c
+27-14module/os/linux/zfs/zfs_file_os.c
+1-10include/sys/zfs_file.h
+89-604 files

OpenZFS/src 56df630 — cmd ztest.c

zfs_file: replace zfs_file_t in ztest to simulate failure

This is the only place that reaches into an existing zfs_file_t to mess
with its contents. Now that zfs_file_get() works on an existing (non-)
fd, we can just replace the zfs_file_t outright.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19231
DeltaFile
+2-2cmd/ztest.c
+2-21 files

OpenZFS/src 863f496 — lib/libzpool zfs_file_os.c

zfs_file: implement _get/_put for userspace

Simple enough just to wrap the existing fd, whatever it is, in a
zfs_file_t.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19231
DeltaFile
+11-8lib/libzpool/zfs_file_os.c
+11-81 files

OpenZFS/src 6329d0c — cmd/zfs zfs_main.c, tests/runfiles sanity.run common.run

zfs: honour the refreserv alias in zfs create -V

When creating a volume without -s, the zfs command adds the default
reservation unless the property list already has one.  It only looks
for the full property name, so a reservation given with the documented
"refreserv" alias is overridden by the default:

  # zfs create -V 1G -o refreserv=none pool/vol
  # zfs get -Hpo value refreservation pool/vol     # 1G plus metadata

Look for the property in the validated list instead, where aliases
have been resolved to the full name.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Ameer Hamza <ameer.hamza at truenas.com>
Closes #19227
DeltaFile
+57-0tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_refreserv.ksh
+5-2cmd/zfs/zfs_main.c
+1-1tests/runfiles/sanity.run
+1-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+65-45 files

OpenZFS/src ba3a938 — lib/libzfs libzfs_dataset.c, tests/runfiles sanity.run common.run

libzfs: restore the reservation when a volsize change fails

When the volsize of a volume changes, libzfs also sets the matching
reservation if the volume is thick provisioned, or if
refreservation=auto is given.  The kernel sets the two properties
independently, so when the volsize cannot change but the reservation
can, e.g. on a read-only volume or one whose encryption key is not
loaded, the volume is left reserving space for a size it does not
have, and later volsize changes no longer adjust the reservation.

libzfs already puts the old volsize back when the reservation fails
with ENOSPC.  Also put the old reservation back when the kernel's
error list has the volsize but not the reservation: set the old local
value again, or drop the new local value so that the default or
received one applies, as "zfs inherit -S" does.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Ameer Hamza <ameer.hamza at truenas.com>
Closes #19227
DeltaFile
+124-0tests/zfs-tests/tests/functional/reservation/reservation_024_neg.ksh
+58-0lib/libzfs/libzfs_dataset.c
+1-1tests/runfiles/sanity.run
+1-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+185-25 files

OpenZFS/src 7454747 — lib/libzfs libzfs_util.c libzfs_dataset.c, tests/runfiles sanity.run common.run

libzfs: support refreservation=auto in zfs_create()

zprop_parse_value() stores refreservation=auto as UINT64_MAX for
zfs_fix_auto_resv() to replace with the real size, which "zfs set" and
"zfs clone" do.  zfs_create() passes it to the kernel as is, so
"zfs create -V 1G -o refreservation=auto pool/vol" fails with "out of
space", as does any libzfs consumer that asks for "auto".  A plain
"zfs create -V" is unaffected only because the zfs command computes
the reservation itself.

Resolve "auto" in zfs_create() from the volsize and volblocksize being
created.  The volume gets the reservation that "zfs create -V" sets
for the same volsize and volblocksize, so zfs_add_synthetic_resv()
keeps it in step with later volsize changes.  As with any explicit
refreservation, -s does not override it.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Ameer Hamza <ameer.hamza at truenas.com>
Closes #19227
DeltaFile
+132-0tests/zfs-tests/tests/functional/reservation/reservation_023_pos.ksh
+35-0lib/libzfs/libzfs_dataset.c
+10-0tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh
+2-1lib/libzfs/libzfs_util.c
+1-1tests/runfiles/sanity.run
+1-1tests/runfiles/common.run
+181-31 files not shown
+182-37 files

OpenZFS/src eab9aee — lib/libzfs libzfs_dataset.c

libzfs: compute the refreservation=auto value in one place

zfs_add_synthetic_resv() keeps a volume's reservation in step with its
volsize only while it equals zvol_volsize_to_reservation() for the
current volsize and volblocksize, and zfs_fix_auto_resv() sets that
same value when "zfs set" or "zfs clone" is given refreservation=auto.
Both build the same one-entry nvlist to get it.  Move that into
zvol_auto_resv() so they share one computation, which zfs_create()
will use next.

No functional change.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Ameer Hamza <ameer.hamza at truenas.com>
Closes #19227
DeltaFile
+26-19lib/libzfs/libzfs_dataset.c
+26-191 files

OpenZFS/src 84332e7 — scripts kmodtool

kmodtool: use kABI-baseline naming on RHEL to prevent kmod accumulation

On RHEL, errata kernels within a minor release share a stable kABI.
The existing kmodtool generates a unique kmod package name per exact
kernel version (e.g. kmod-zfs-5.14.0-687.52.1.el9_8), which causes
unbounded kmod package accumulation as new errata kernels are installed
and akmods rebuilds for each one.

Port the kABI-aware naming logic from RPM Fusion's kmodtool:

- Add init_kernel_uname_r_vars() to parse kernel uname -r into
  components including the kABI baseline (kernel_uname_r_short).
  Example: 5.14.0-687.52.1.el9_8.x86_64 -> 5.14.0-687.el9_8

- On RHEL (%{?rhel}), use kernel_uname_r_short in package names
  so all errata kernels within a minor release produce the same
  package name (e.g. kmod-zfs-5.14.0-687.el9_8).

- On Fedora (no kABI guarantee), keep the full kernel_uname_r in

    [18 lines not shown]
DeltaFile
+197-42scripts/kmodtool
+197-421 files

OpenZFS/src 497f28f — module/zfs vdev_raidz.c, tests/runfiles common.run

vdev_raidz: keep unverified dRAID rebuild repairs speculative

A sequential rebuild has no checksum, so a dRAID row reconstructed with
all of its parity cannot be verified. Such repairs carry
ZIO_FLAG_SPECULATIVE, which limits a repair of a spare or replacing
column to the device being rebuilt. Since 0d1f3b1c6 skips parity
regeneration when no parity column failed, the flag is set only on the
remaining path, and a row whose missing column holds data repairs every
child of a spare or replacing column with unverified data, including
the original device.

Set the flag whenever a rebuild row is not verified by spare parity,
independently of regenerating parity.

Cover a rebuild onto a hot spare while another child is offline and
reads of the original child return flipped bits: the original must have
no checksum errors once the offline child returns and the pool is
scrubbed.


    [3 lines not shown]
DeltaFile
+79-0tests/zfs-tests/tests/functional/replacement/rebuild_draid_speculative.ksh
+12-11module/zfs/vdev_raidz.c
+2-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+94-124 files

OpenZFS/src 8978e43 — cmd Makefile.am, cmd/zfs Makefile.am

gettext: remove linking to libintl

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19219
DeltaFile
+0-2lib/libzfs_core/Makefile.am
+0-2cmd/zpool/Makefile.am
+0-2cmd/zfs/Makefile.am
+0-2cmd/Makefile.am
+1-1lib/libzfs/Makefile.am
+1-1lib/libnvpair/Makefile.am
+2-101 files not shown
+2-127 files

OpenZFS/src c96b535 — config iconv.m4 gettext.m4

config: remove gettext, iconv and related detection

Since we are no longer using libintl or gettext, we no longer need to
detect it. This lets us get rid of a lot of autoconf support that wasn't
used anywhere else. This is largely reverting e8864b1b28.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19219
DeltaFile
+0-775config/lib-link.m4
+0-684config/config.rpath
+0-645config/host-cpu-c-abi.m4
+0-451config/po.m4
+0-387config/gettext.m4
+0-288config/iconv.m4
+0-3,2307 files not shown
+1-3,78213 files

OpenZFS/src 6c7bce1 — cmd mount_zfs.c, cmd/zfs zfs_main.c

gettext: remove calls to textdomain()

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19219
DeltaFile
+0-1cmd/zpool/zpool_main.c
+0-1cmd/zfs/zfs_main.c
+0-1cmd/mount_zfs.c
+0-33 files

OpenZFS/src 9c704d9 — lib/libzfs libzfs_share.c libzfs_crypto.c

gettext: remove calls to dgettext()

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19219
DeltaFile
+326-332lib/libzfs/libzfs_pool.c
+283-286lib/libzfs/libzfs_sendrecv.c
+237-248lib/libzfs/libzfs_dataset.c
+236-236lib/libzfs/libzfs_util.c
+151-154lib/libzfs/libzfs_crypto.c
+37-37lib/libzfs/libzfs_share.c
+1,270-1,29310 files not shown
+1,416-1,45116 files

OpenZFS/src dcf16dc — cmd mount_zfs.c, cmd/zfs zfs_main.c

gettext: remove calls to gettext()

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19219
DeltaFile
+1,001-1,001cmd/zpool/zpool_main.c
+620-620cmd/zfs/zfs_main.c
+119-120cmd/zpool/zpool_vdev.c
+43-43cmd/mount_zfs.c
+32-32lib/libzfs/libzfs_pool.c
+24-24tests/zfs-tests/cmd/mkfile.c
+1,839-1,8407 files not shown
+1,871-1,87213 files

OpenZFS/src e2b3168 — cmd zfs_ids_to_path.c mount_zfs.c, cmd/zfs zfs_project.c zfs_main.c

gettext: remove libintl.h inclusion

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19219
DeltaFile
+0-1cmd/zpool/os/freebsd/zpool_vdev_os.c
+0-1cmd/zfs_ids_to_path.c
+0-1cmd/zfs/zfs_project.c
+0-1cmd/zfs/zfs_main.c
+0-1cmd/zfs/zfs_iter.c
+0-1cmd/mount_zfs.c
+0-628 files not shown
+0-3434 files

OpenZFS/src 5180219 — include/sys vdev_impl.h, lib/libspl/include/sys sysmacros.h

Add alloc factor logic

RAIDz vdevs always perform allocations in multiples of nparity + 1
sectors. This is to prevent fragmentation from leaving small scattered
records everywhere that cannot be allocated and just pollute the
spacemaps. This rule was always preserved until the introduction of the
allocation range code, which allows allocation of not just specific
sizes, but anywhere in a range. The sizes that end up being allocated
may not be a multiple of nparity + 1 sectors in certain cases (primarily
when the allocation is at the end of a metaslab).  If that happens, when
converting from the asize to the psize and back, we can end up with two
different psize values, which can theoretically cause issues in a few
different ways.

This PR adds logic to the metaslab code to check if there is a factor
that the allocations must be a multiple of, and if we're doing a
dynamically sized allocation, ensures that the allocation meets that
requirement.


    [5 lines not shown]
DeltaFile
+41-10module/zfs/metaslab.c
+21-0module/zfs/vdev.c
+12-0module/zfs/vdev_raidz.c
+12-0module/zfs/vdev_draid.c
+3-0lib/libspl/include/sys/sysmacros.h
+2-0include/sys/vdev_impl.h
+91-101 files not shown
+92-107 files

OpenZFS/src bbfc014 — cmd ztest.c

ztest: do not use a detached vdev in online_vdev()

online_vdev() drops the config lock to online a device. If the
configuration changed meanwhile, the vdev may have been detached or
replaced and freed, which the function detects before returning. Its
verbose message then still read the old top-level vdev's state, a
use-after-free that AddressSanitizer reports during zloop runs, and
both abort paths returned the possibly freed vdev to stop the walk.

Log the saved GUID and expected generation together with the current
configuration generation, without dereferencing the old vdev. Stop
the walk with the root vdev, which stays valid under the reacquired
lock.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19224
DeltaFile
+6-6cmd/ztest.c
+6-61 files

OpenZFS/src 37884cf — . CLAUDE.md .gitignore

docs: add repository notes for coding agents

Document portability, compatibility, safe testing and patch preparation
for coding agents. Share the instructions through a CLAUDE.md symlink.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: George Melikov <mail at gmelikov.ru>
Closes #19230
DeltaFile
+124-0AGENTS.md
+2-0.gitignore
+1-0CLAUDE.md
+127-03 files

OpenZFS/src 8de0800 — tests/zfs-tests/tests/functional/removal removal_with_ganging.ksh

ZTS: restore metaslab_force_ganging after removal_with_ganging

The cleanup of removal_with_ganging sets metaslab_force_ganging to
131073 instead of the value it replaced. Every later test on the same
runner then gangs about 3% of its blocks larger than 128K, since
metaslab_force_ganging_pct defaults to 3. A test that needs a plain
1M block fails intermittently; replacement/indirect_reconstruct did on
FreeBSD CI.

Save the tunable before changing it and restore it on exit, as the
other tests that force ganging do. Register cleanup after the save,
before pool setup and the tunable write, so setup failures restore it
too.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19207
DeltaFile
+3-2tests/zfs-tests/tests/functional/removal/removal_with_ganging.ksh
+3-21 files

OpenZFS/src f3ad49d — tests/zfs-tests/include libtest.shlib

ZTS: preserve failures when saving and restoring tunables

save_tunable hides a failed get_tunable behind echo, and
restore_tunable hides a failed set_tunable64 behind rm. A test can
therefore report successful cleanup while leaving its changed tunable
in place and discarding the saved value.

Check the tunable and saved-value reads, and return a failed setter's
status before deleting the saved value. A failed restore then retains
the value for a retry, and log_must reports the cleanup failure.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19207
DeltaFile
+8-3tests/zfs-tests/include/libtest.shlib
+8-31 files

OpenZFS/src 7f838b8 — lib/libzfs libzfs_util.c

libzfs: fix a double free of the btree leaf cache

Since commit e903655c50 ("zpool: Add zpool status -vv error ranges"),
libzfs_init() creates the process-wide btree leaf cache and
libzfs_fini() destroys it, once per call.  A process that holds more
than one handle, as zed does with four, leaks a cache on every init
after the first and frees the same cache again on every fini after the
first, so zed aborts with "double free detected" when it stops.  A
handle still in use after another handle's fini also allocates from
the freed cache when zpool_get_errlog() builds its range tree.

Count the handles and create the cache with the first and destroy it
with the last, as libzfs_core_init() and libzfs_core_fini() do for the
shared /dev/zfs descriptor.

The ZFS_SENDRECV_MAX_NVLIST error path of libzfs_init() now calls
libzfs_fini() instead of undoing a few steps by hand, which also stops
it from leaking the URI regex and the libzfs_core hold, and the two
earlier error paths free the regex as well.

    [4 lines not shown]
DeltaFile
+32-4lib/libzfs/libzfs_util.c
+32-41 files

OpenZFS/src f79c81d — .github/workflows smatch.yml

CI: apt-get update before installing smatch dependencies (#19237)

The smatch job installs packages without refreshing the runner's
package lists.  Since 2026-09-30 the lists in the runner image point
at a libdbi-perl security update that the mirrors no longer carry, so
the install fails with "404 Not Found" and every smatch run fails
before smatch is built.  Run apt-get update first, as #18609 did for
the purge step of the other workflows.

Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
DeltaFile
+1-0.github/workflows/smatch.yml
+1-01 files

OpenZFS/src 86b3fb1 — include/sys spa_impl.h, module/zfs spa_misc.c spa.c

Build the pool stats config without the namespace lock

The spa_open_common() function built the full config with vdev stats
while it held the namespace lock. Every pool lookup in the system waits
on that lock, so polling stats on a pool with many vdevs slowed down
unrelated pool operations. The config is now built after the lock is
dropped. spa_config_generate() takes the config locks it needs. The
recovery load info is copied while the lock is still held.

A stats caller now holds the pool for as long as the build takes, which
can be hundreds of milliseconds on a pool with many vdevs. Export fails
with "pool is busy" when it sees such a hold, so running zpool iostat or
zpool status in a loop would break zpool export, zpool destroy and
zpool split. To avoid this, stats callers count their hold, and export
waits for that count to drop to zero before it sets spa_export_thread.
New stats callers wait while the pool is being exported, so the wait
always ends. The hold and its count are taken and dropped together
under the namespace lock. As before, export holds the namespace lock
from setting spa_export_thread until it checks the pool references.

    [8 lines not shown]
DeltaFile
+71-12module/zfs/spa.c
+62-0tests/zfs-tests/tests/functional/cli_root/zpool_export/zpool_export_stats_pos.ksh
+2-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+1-0module/zfs/spa_misc.c
+1-0include/sys/spa_impl.h
+138-136 files

OpenZFS/src ce44791 — module/os/linux/zfs zfs_file_os.c

Linux: don't fail send/recv on job control stop

Suspending a zfs send or receive that writes to or reads from a pipe
with ^Z kills it: "cannot send: signal received" for send, and
"internal error: Bad file descriptor" plus an abort for receive.

On Linux the stream is written in the ioctl thread itself.  A pending
SIGTSTP makes a blocking pipe_write()/pipe_read() return -ERESTARTSYS
or a short count, and the send/recv path treats that as a fatal error.
issig() already knows how to stop the thread on SIGSTOP/SIGTSTP (commit
414f7249d), but it is only reached after the I/O error has been
recorded.

Retry the interrupted kernel_write()/kernel_read() in zfs_file_write()
and zfs_file_read() when issig() reports that the pending signal was
only a stop signal: the thread stops there, and the I/O continues from
where it stopped once it is resumed.  Any other signal still aborts the
operation as before.


    [3 lines not shown]
DeltaFile
+29-5module/os/linux/zfs/zfs_file_os.c
+29-51 files

OpenZFS/src 146d0ec — contrib/debian openzfs-zfsutils.examples not-installed, etc/zfs vdev_id.conf.sas_expander.example

vdev_id: add sas_expander topology

Certain external JBODs present multiple internal expanders (front and
backside slots, for example), which each have respective bay and phy 0,
and so on.  This results in none of the current topologies being able 
to sensibly map such a setup.  Disks will inevitably overlap, since 
the same port has multiple disks in bay or phy 0.

This adds a new topology, sas_expander, which assigns disks to channels
based on the address of the rightmost expander in their path.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>
Closes #19070
DeltaFile
+40-9udev/vdev_id
+18-1man/man5/vdev_id.conf.5
+6-2man/man8/vdev_id.8
+7-0etc/zfs/vdev_id.conf.sas_expander.example
+1-0contrib/debian/openzfs-zfsutils.examples
+1-0contrib/debian/not-installed
+73-121 files not shown
+74-127 files

OpenZFS/src f239ea9 — include/sys dsl_dataset.h, module/zfs dmu_objset.c zfs_ioctl.c

Walk snapshot names without holding the objset in list-next ioctl

ZFS_IOC_SNAPSHOT_LIST_NEXT walks the snapnames ZAP, which lives in the
MOS, so it only needs the dataset.  It held the objset instead, and for
an unmounted filesystem or an idle volume that means building a complete
objset_t and tearing it down again on every call, once per snapshot
returned.

Hold the pool and the dataset, and move the ZAP walk into
dsl_dataset_snapshot_list_next(), which dmu_snapshot_list_next() now
wraps for its remaining callers.  Listing a dataset's snapshots no
longer fails when the dataset's own objset block cannot be read.

Reviewed-by: Rob Norris <rob.norris at truenas.com>
Reviewed-by: Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ameer Hamza <ameer.hamza at truenas.com>
Closes #19208
DeltaFile
+48-0module/zfs/dsl_dataset.c
+30-17module/zfs/zfs_ioctl.c
+2-37module/zfs/dmu_objset.c
+2-0include/sys/dsl_dataset.h
+82-544 files