OpenZFS/src 8e3e47ctests/zfs-tests/include libtest.shlib

ZTS: don't mistake a compiled-in kmemleak for a running one

kmemleak_late_init() creates /sys/kernel/debug/kmemleak before it checks
whether the detector came up, so on a kernel built
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF and booted without kmemleak=on the
file is there and kmemleak is not.  zfs_get_009_pos then skips, and the
two send_realloc tests quietly shrink their workload, on kernels
carrying none of the overhead those concessions are for.

Ask /proc/slabinfo instead: kmemleak_init() does not create the
kmemleak_object cache when it bails out, and SLAB_NOLEAKTRACE keeps that
cache from being merged away under another name.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Moch <mail at alexmoch.com>
Closes #19123
DeltaFile
+6-1tests/zfs-tests/include/libtest.shlib
+6-11 files

OpenZFS/src b6dde8amodule/zfs zio_crypt.c

zio_crypt: free the key unwrap uios when decryption fails

zio_crypt_key_unwrap() allocates a pair of iovec buffers through
zio_crypt_uios_init_os() and releases them with zio_crypt_uios_fini_os()
once the keys have been decrypted.  When zio_decrypt_os() fails it jumps
straight to the error label, which skips that release, so both buffers
are leaked.

The failure is reachable from userland: any key unwrap that does not
authenticate leaks 64 bytes twice, so a loop of "zfs load-key" calls
with the wrong passphrase grows kernel memory without bound.  It is not
Linux specific -- the FreeBSD implementation allocates these buffers as
well.

Release the uios as soon as the crypto operation returns and check the
result afterwards, matching zio_crypt_key_wrap(), which already frees
them unconditionally on both paths.  The buffers are then released
exactly once, and the error label continues to own nothing.


    [7 lines not shown]
DeltaFile
+3-2module/zfs/zio_crypt.c
+3-21 files

OpenZFS/src 5b6906atests/test-runner/bin test-runner.py.in

ZTS: fix test-runner crashing immediately under -m

sudo has no -c option, so it exits with a usage error and the run dies
before the first test case.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Moch <mail at alexmoch.com>
Closes #19117
DeltaFile
+1-1tests/test-runner/bin/test-runner.py.in
+1-11 files

OpenZFS/src e903655cmd/zinject translate.c, cmd/zpool zpool_main.c

zpool: Add zpool status -vv error ranges

Print the byte error ranges with 'zpool status -vv'.  This works
with the normal zpool status formatting flags (-p, -j, --json-int).

In addition:

- Modify ZFS_IOC_OBJ_TO_STATS ioctl to optionally return "extended"
  object stats.
- Let zinject corrupt zvol data.
- Add test case.
- Add DIOCGPHYSPATH geom attribute to FreeBSD zvols.  This works
  basically the same as Linux's BLKZNAME ioctl, and returns the
  dataset name for a zvol (like "tank/vol").  This is used by zinject.

This commit takes code from these PRs: #17502 #9781 #8902

Reviewed-by: Alek Pinchuk <Alek.Pinchuk at connectwise.com>
Reviewed-by: Akash B <akash-b at hpe.com>

    [5 lines not shown]
DeltaFile
+292-25lib/libzfs/libzfs_pool.c
+186-55cmd/zpool/zpool_main.c
+173-0tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_-v.ksh
+75-4cmd/zinject/translate.c
+46-3module/zfs/zfs_znode.c
+23-1module/zfs/zfs_ioctl.c
+795-8811 files not shown
+886-9817 files

OpenZFS/src 3a67db3module/os/linux/zfs zfs_uio.c

Linux: skip hardened usercopy checks in zfs_uiomove_iter()

The check adds nothing here.  It only verifies the copy stays inside
the source object, and for a vmalloc address that object is the entire
SPL slab, not the buffer.  The DMU already bounds every transfer to
the individual dbuf.  The user-supplied destination is validated
inside _copy_to_iter() and is unchanged.

fs/proc/kcore.c and drivers/dax/super.c call the underscore variants
for the same reason.  Both are EXPORT_SYMBOL and predate 4.18.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Reviewed-by: Ameer Hamza <ahamza at ixsystems.com>
Reviewed-by: Richard Yao <richard at ryao.dev>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #19115
DeltaFile
+9-2module/os/linux/zfs/zfs_uio.c
+9-21 files

OpenZFS/src 3fcbafcconfig kernel.m4 kernel-rq-for-each-bvec.m4, include/os/linux/kernel/linux kmap_compat.h

Linux: copy whole multi-page bvecs at once

bio_add_page() merges adjacent pages into one bvec only when they are
contiguous both physically and in the memory map, so on kernels without
HIGHMEM the linear map covers an entire bvec and it can be copied with a
single mapping and memcpy() instead of one per page.  Drop the blanket
PAGE_SIZE clamp in zfs_uiomove_bvec_impl(), and iterate the blk-mq path
with rq_for_each_bvec() rather than rq_for_each_segment(), which splits
every bvec at a page boundary.  For a 1MB zvol read the number of
memcpy() calls per block drops by an order of magnitude, depending on
how well the caller's pages merged.

CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP maps even lowmem pages one at a time,
so PageHighMem() on its own does not tell us whether a mapping spans
the whole bvec.  Add zfs_kmap_partial() for that question and use it in
abd_iter_map() too, where the same assumption was already being made.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>

    [2 lines not shown]
DeltaFile
+32-5module/os/linux/zfs/zfs_uio.c
+29-0config/kernel-rq-for-each-bvec.m4
+17-0include/os/linux/kernel/linux/kmap_compat.h
+2-3module/os/linux/zfs/abd_os.c
+2-0config/kernel.m4
+82-85 files

OpenZFS/src 2dece2acmd/zstream zstream_io.c zstream_validate.c, tests/runfiles common.run

zstream: report invalid record context without assertions

Stream framing and BEGIN payload size depend on the input.  Report
invalid values as ordinary errors with the record offset instead of
terminating through VERIFY assertions.

Reject oversized BEGIN payloads before allocating or reading them.
Track compound-stream conclusions explicitly so valid compound sends
remain accepted while stray END records and records after a conclusion
are rejected.

Add ZTS coverage for malformed streams in both byte orders and for
valid compound streams.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Garth Snyder <garth at garthsnyder.com>
Signed-off-by: Matthias Goergens <matthias.goergens at gmail.com>
Closes #19097
DeltaFile
+74-0tests/zfs-tests/tests/functional/zstream/make-invalid-context-streams.py
+69-0tests/zfs-tests/tests/functional/zstream/zstream_validate_002_neg.ksh
+31-7cmd/zstream/zstream_validate.c
+7-3cmd/zstream/zstream_io.c
+1-1tests/runfiles/common.run
+2-0tests/zfs-tests/tests/Makefile.am
+184-116 files

OpenZFS/src f5b2fc8include/os/linux/zfs/sys zpl.h, module/os/linux/zfs zfs_ctldir.c zpl_inode.c

zfs_ctldir: make .zfs/snapshot/<name> btime the snapshot creation time

Before the automount, '.zfs/snapshot/<name>' is a placeholder inode
using simple_dir_inode_operations, which has no getattr, so statx(2)
reports no birth time. Once mounted, it is the snapshot's root
directory and reports that directory's crtime, i.e. the dataset
creation time. A consumer therefore gets either no birth time or the
dataset creation time, never the snapshot's, and the answer changes
when the snapshot is automounted.

Report the snapshot creation time as stx_btime consistently in both
states, so it can be read with a plain statx(2) on the path. Give
the placeholder its own inode_operations with a getattr that returns
the creation time zfsctl_inode_alloc() already stores, and override
the birth time of a mounted snapshot's root in zfs_getattr_fast()
next to the existing inode number override. The STATX_BTIME copy
moves from zpl_getattr() into zfs_getattr_fast() so the override is
not overwritten. Add snapdir_stat_btime to ZTS.


    [3 lines not shown]
DeltaFile
+88-0tests/zfs-tests/tests/functional/snapdir/snapdir_stat_btime.ksh
+35-3module/os/linux/zfs/zpl_ctldir.c
+18-1module/os/linux/zfs/zfs_vnops_os.c
+0-7module/os/linux/zfs/zpl_inode.c
+3-1module/os/linux/zfs/zfs_ctldir.c
+2-0include/os/linux/zfs/sys/zpl.h
+146-122 files not shown
+148-138 files

OpenZFS/src fa4bc4dman/man7 zpool-features.7, module/zfs spa_errlog.c

spa_errlog: don't let one unresolvable entry hide the whole error log

process_error_log() returns as soon as process_error_block() fails on
an entry, so one error log entry whose dataset cannot be opened fails
ZFS_IOC_ERROR_LOG as a whole.  "zpool status" still says "N data
errors, use '-v' for a list", but "zpool status -v" lists nothing and
prints "errors: List of errors unavailable" on stderr.  Two ways to
get there: an encrypted filesystem whose key is unloaded after its
error was recorded, where the DS_HOLD_FLAG_DECRYPT hold in
find_top_affected_fs() fails with EACCES; and an error in a snapshot
recorded while the key was unloaded, which is keyed by the snapshot
itself and not purged when that snapshot is destroyed, so the hold
fails with ENOENT.

0c4064d9a0 ("Fix zpool status in case of unloaded keys") already
reports a block whose birth txg was never resolved as a bare bookmark.
Do the same when the dataset walk fails: report the bookmark, which
zpool(8) prints as "fs:<0xobj>" or "<0xobjset>:<0xobj>", and go on
with the rest of the log.  The entry stays in the log until it can be

    [14 lines not shown]
DeltaFile
+102-0tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_011_pos.ksh
+87-0tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_010_pos.ksh
+30-9module/zfs/spa_errlog.c
+7-1tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_005_pos.ksh
+2-2tests/runfiles/common.run
+1-1man/man7/zpool-features.7
+229-131 files not shown
+231-137 files

OpenZFS/src 44aa82aman/man8 zpool-reguid.8, module/os/linux/zfs zpl_file.c

linux: support the FS_IOC_GETFSUUID ioctl

Populate the superblock UUID (sb->s_uuid) at mount time, through
super_set_uuid() on Linux 6.9 and later (the VFS then serves the
FS_IOC_GETFSUUID ioctl) and through a direct write plus a zpl_ioctl()
handler on older kernels.  Add ZTS tests that check the UUID of
files, directories, snapshot automounts, received snapshots and
filesystems, and clones, the UUID change after "zpool reguid", and
the zfs_sb_uuid opt-out.

The UUID holds the 64-bit pool guid and the 64-bit dataset guid as
big-endian values, so its hex halves show the same numbers as "zpool
get guid" and "zfs get guid"; the pool guid keeps it unique across
pools, for example after "zpool split".  It is not a valid RFC 4122
UUID, but the kernel treats sb->s_uuid as an opaque byte string.
Each mounted filesystem, snapshot and clone gets its own UUID, except
that a snapshot received into the same pool shares the guid, and thus
the UUID, of its source snapshot; a "zpool reguid" or a send/receive
re-creation changes the UUID at the next mount.

    [16 lines not shown]
DeltaFile
+127-0tests/zfs-tests/tests/functional/getfsuuid/getfsuuid_001_pos.ksh
+86-0tests/zfs-tests/cmd/getfsuuid.c
+77-1man/man8/zpool-reguid.8
+76-0tests/zfs-tests/tests/functional/getfsuuid/getfsuuid_003_pos.ksh
+73-0tests/zfs-tests/tests/functional/getfsuuid/getfsuuid_002_pos.ksh
+51-0module/os/linux/zfs/zpl_file.c
+490-116 files not shown
+759-522 files

OpenZFS/src 9388f24config kernel.m4

build: Handle case where no kernel compile tests are necessary

When caching the results of configure, a subsequent configure has the
results of all kernel compile tests cached and thus does not need to
run them. Properly handle this case.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19106
DeltaFile
+9-0config/kernel.m4
+9-01 files

OpenZFS/src 9a47865config kernel.m4

build: Cache build results of unchecked kernel tests

If caching is enabled, kernel tests with a cached result will be
skipped, all others will be unconditionally run. However, then when
checking and caching the build results, not all run tests will be
checked and cached. This is because some test results don't need to
be checked depending on the result of other tests. Since these
unchecked test results were not cached, they will subsequently always
be run, even though they are never used.

Instead, after all the results checking has finished, go through all
tests whose results have not been checked and cache them.

Also, remove superfluous line in ZFS_LINUX_CONFTEST_MAKEFILE.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19106
DeltaFile
+23-1config/kernel.m4
+23-11 files

OpenZFS/src a05edc8config kernel.m4

build: Ensure build dir is created for kernel option compatibility check

This bug was uncovered by the fix for CONFIG_DEBUG_LOCK_ALLOC in the
previous commit, which happened before this, whose check would never
be skipped and whose check ensured that the build directory was created.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19106
DeltaFile
+1-0config/kernel.m4
+1-01 files

OpenZFS/src 66ed6c2config kernel-zero_page.m4 kernel-kasan-enabled.m4

build: Properly cache test results

Align the cache variable names for these tests so that they can be
skipped after having been run when caching is enabled. These tests
were checking a cache variable name that was different from the one
set after the checking the results of the test.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19106
DeltaFile
+1-1config/kernel-zero_page.m4
+1-1config/kernel-kasan-enabled.m4
+1-1config/kernel-config-defined.m4
+3-33 files

OpenZFS/src c69f0e3lib/libzfs_core libzfs_core.c

libzfs_core: block delivery of SIGUSR1 in send_worker thread

This fixes a Linux-specific bug.

3a909fe33 (libzfs, libzfs_core: send: always write to pipe, 2022-02-21)
introduced a subtle bug where zfs send -RPv would not print status
information periodically anymore when the stdout is redirected to
something that isn't a pipe (e.g. >/dev/null).

This is because the send_worker thread introduced by this commit
is created with an unmodified signal mask from libzfs. When
zfs_send_space is called it creates this thread.  When we request
verbose status information another thread is created which, in
theory, should periodically receive a SIGUSR1 via a POSIX timer.

The main thread blocks USR1 delivery *after* the creation of the
progress thread, leaving the send_worker thread's signal mask
unmodified. The delivery of SIGUSR1 is now random and for at least
Debian Trixie with kernel 6.12.107+deb13-amd64 this causes the

    [12 lines not shown]
DeltaFile
+25-2lib/libzfs_core/libzfs_core.c
+25-21 files

OpenZFS/src 4148c22module Makefile.in, rpm/generic zfs-kmod.spec.in

build: Fix building kernel module when builddir is different from srcdir

It was noticed and fixed in f2f4ada24 (Linux 6.10 compat: fix rpm-kmod
and builtin) that the kernel was changed in 6.10 to make it difficult
have the build directory be different from the source directory. The
fix is to copy the module sources to the build directory. However, the
fix was only applied to building distro packages. This same problem
exists when building outside of the root of the source tree.

Instead do the copy when building the modules-Linux target, which
initiates the kernel module build. Commit f2f4ada24 hardlinks the
source files because it knows they are on the same filesystem. However,
this is not necessarily true generally when having a separate build
directory. So make a symlink tree instead of hardlinks. Also, only do
the copy if the build directory is different from the source tree.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19105
DeltaFile
+0-17rpm/generic/zfs-kmod.spec.in
+8-0module/Makefile.in
+8-172 files

OpenZFS/src 78f49e1module/os/linux/zfs vdev_disk.c

vdev_disk: simplify alignment checks for linear ABDs

A linear ABD is a single contiguous range, so only its first page
can carry an offset and only its last one can be short. That leaves
the alignment of the buffer as the only thing to check, and no
reason to look up the pages.

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 #19102
DeltaFile
+12-2module/os/linux/zfs/vdev_disk.c
+12-21 files

OpenZFS/src 04424a5config user-libtirpc.m4

Suggest libtirpc-dev for Ubuntu builds

A minimal Ubuntu install does not include libtirpc and ./configure
fails with "... try installig libtirpc-devel", but that package is
named libtirpc-dev on Ubuntu.

Fix the error message to mention both package names.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Andreas Dilger <adilger at thelustrecollective.com>
Closes #19103
DeltaFile
+2-2config/user-libtirpc.m4
+2-21 files

OpenZFS/src 7adc908. Makefile.am, contrib/debian rules.in

build: Add gitrev as a dependency to specific targets that require it

The gitrev target was added as a dependency of the "all" target in
e6c093dd94 as previous to that it was a dependency of all built
sources, including the dist target for which it is unnecessary. This
the meant that the gitrev target would only be triggered when running
the "all" target. All subtargets that have an indirect dependency would
not trigger the gitrev target. Practically this means that building
directly certain binary targets, like zdb, would fail like so:

$ make zdb
  CC       module/zfs/libzpool_la-abd.lo
... snip ...
  CC       module/zfs/libzpool_la-uberblock.lo
/home/user/zfs.git/module/zfs/spa_history.c:32:10: fatal error: zfs_gitrev.h: No such file or directory
   32 | #include "zfs_gitrev.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:11422: module/zfs/libzpool_la-spa_history.lo] Error 1

    [20 lines not shown]
DeltaFile
+5-2module/Makefile.in
+3-1Makefile.am
+1-1contrib/debian/rules.in
+9-43 files

OpenZFS/src f704841include/os/freebsd/zfs/sys zio_crypt_os.h, module Makefile.bsd

zio_crypt_os: implement platform interface for FreeBSD

This uses our internal "crypto_os" shim as the backend to the FreeBSD
kernel crypto. There's no particular reason this separate shim needs to
exist anymore, but we keep it for now to keep this interface small.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18884
DeltaFile
+0-1,809module/os/freebsd/zfs/zio_crypt.c
+169-0module/os/freebsd/zfs/zio_crypt_os.c
+8-0include/os/freebsd/zfs/sys/zio_crypt_os.h
+2-1module/Makefile.bsd
+179-1,8104 files

OpenZFS/src 1df943dinclude/os/linux/zfs/sys zio_crypt_os.h, include/sys zio_crypt_os_icp.h

zio_crypt_os: implement platform interface for ICP

This is now a generic implementation for any platform that wants to use
the ICP for its crypto. It exists in the "common" module source, linked
and wired for Linux and libzpool.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18884
DeltaFile
+0-2,076module/os/linux/zfs/zio_crypt.c
+302-0module/zfs/zio_crypt_os_icp.c
+31-0include/sys/zio_crypt_os_icp.h
+2-2lib/libzpool/Makefile.am
+2-1lib/libzpool/include/sys/zio_crypt_os.h
+2-1include/os/linux/zfs/sys/zio_crypt_os.h
+339-2,0802 files not shown
+342-2,0818 files

OpenZFS/src 542327ainclude/sys zio_crypt.h, module/zfs zio_crypt.c

zio_crypt: establish platform interface; rework common code to use it

This lifts out and generalises the common parts of linux/zio_crypt and
freebsd/zio_crypt into a common version, with a
platform/backend-specific API for the not-common parts.

The common parts here involve key management, data assembly for
encrypt/decrypt, on-disk formats and so on - the "logic" side of the
equation, which are subtle and definitely shouldn't be duplicated. The
platform-specific parts meanwhile are mostly just glue to get in and out
of the platform-provided cryptographic suite.

To be clear - this is not a particular _good_ API, but further
improvement requires changes in the logic code. Establishing a clear
boundary will allow that change to be worked on more safely.

In the header, we add platform-specific types for the two places where
incompatible concepts leaked through from the implementations:


    [35 lines not shown]
DeltaFile
+1,678-0module/zfs/zio_crypt.c
+61-11include/sys/zio_crypt.h
+1,739-112 files

OpenZFS/src 6745887include/os/freebsd Makefile.am, include/os/freebsd/zfs/sys zio_crypt_os.h

zio_crypt: add platform-specific headers

As we pull platform-specific things out of zio_crypt, we'll need
somewhere to move things to.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18884
DeltaFile
+23-0include/os/freebsd/zfs/sys/zio_crypt_os.h
+23-0include/os/linux/zfs/sys/zio_crypt_os.h
+23-0lib/libzpool/include/sys/zio_crypt_os.h
+2-11include/sys/zio_crypt.h
+2-1lib/libzpool/include/Makefile.am
+1-0include/os/freebsd/Makefile.am
+74-121 files not shown
+75-127 files

OpenZFS/src 008cd45include/sys zio_crypt.h, module/os/freebsd/zfs crypto_os.c

zio_crypt: single field for mechname

On FreeBSD, it's only used in debug output anyway; there's definitely
no need for it to not just be a normal string in both.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18884
DeltaFile
+3-10include/sys/zio_crypt.h
+2-4module/os/freebsd/zfs/crypto_os.c
+5-142 files

OpenZFS/src 3f58117include/os/linux/spl/sys uio.h, module/os/linux/zfs zfs_uio.c

linux/uio: don't require wrapped data to be const

This makes it harder to work with zfs_uio_t internally ourselves, for no
apparently good reason. If a caller has a const iovec/bvec that they
want to wrap in a uio, its up to them to either cast away the const or
copy the data as appropriate. As it is, there does not appear to be any
places within OpenZFS that require such action.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18884
DeltaFile
+3-3include/os/linux/spl/sys/uio.h
+2-2module/os/linux/zfs/zfs_uio.c
+5-52 files

OpenZFS/src 1004b19include/os/freebsd/spl/sys uio.h, include/os/linux/spl/sys uio.h

uio: add zfs_uio_iov() accessor for uio_iov

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18884
DeltaFile
+1-0lib/libspl/include/sys/uio.h
+1-0include/os/linux/spl/sys/uio.h
+1-0include/os/freebsd/spl/sys/uio.h
+3-03 files

OpenZFS/src 994fb17module/zfs vdev.c, tests/zfs-tests/tests/functional/replacement replace_resilver_sit_out.ksh

Fix metaslab count assertion in metaslab_group_alloc() for small vdevs

When creating a pool on a small vdev (< 1GB) with a low
zfs_vdev_min_ms_count value (e.g., 2), vdev_metaslab_set_size() could
compute a metaslab shift that results in fewer metaslabs than
zfs_vdev_min_ms_count, triggering an assertion failure in
metaslab_group_alloc():
ASSERT3U(mg->mg_vd->vdev_ms_count, >=, 2) failed (1 >= 2)

The root cause is that highbit64(asize / zfs_vdev_min_ms_count) returns
last set bit, which can yield a metaslab size larger than
asize / zfs_vdev_min_ms_count. For example, with a 500MB vdev and
zfs_vdev_min_ms_count=2:
- asize / 2 = 250MB
- highbit64(250MB) = 28, giving 256MB metaslabs
- 500MB / 256MB = 1 metaslab (violates minimum of 2)

Fix by subtracting 1 from highbit64() result to ensure the metaslab
size is at most asize / zfs_vdev_min_ms_count, guaranteeing at least

    [22 lines not shown]
DeltaFile
+5-1module/zfs/vdev.c
+3-2tests/zfs-tests/tests/functional/trim/autotrim_config.ksh
+1-1tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh
+9-43 files

OpenZFS/src 02b5baftests/test-runner/bin zts-report.py.in

ZTS: Add import_relax_metadata_damaged exception

The newly added import_relax_metadata_damaged test case is flaky.
Add it to the exceptions script until the underlying issue is resolved.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Issue #19077
Closes #19104
DeltaFile
+1-0tests/test-runner/bin/zts-report.py.in
+1-01 files

OpenZFS/src 99831decmd/zdb zdb.c, include libzdb.h

zdb: Allow filtering on zvol objects

Allow "v" flag for object ID range filters for filtering on zvol
objects. Also, fixup tests so that "v" is now considered a valid
flag.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19069
DeltaFile
+6-0cmd/zdb/zdb.c
+1-1tests/zfs-tests/tests/functional/cli_root/zdb/zdb_object_range_neg.ksh
+2-0man/man8/zdb.8
+2-0include/libzdb.h
+11-14 files

OpenZFS/src bf71aafman/man4 spl.4, module/os/linux/spl spl-kmem-cache.c

spl: Honour forced Linux slab cache selection

spl_kmem_cache_slab_limit controls automatic cache selection. An
explicit KMC_SLAB request should override that cutoff, but the Linux
slab branch applies it again. With a zero cutoff, this rejects the
forced znode cache. Pool creation later dereferences the NULL cache in
spl_kmem_cache_alloc().

Automatic selection has already applied the cutoff before this branch.
Remove the redundant check so KMC_SLAB retains its documented force
semantics, and clarify the automatic cutoff's scope in spl(4).

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Matthias Goergens <matthias.goergens at gmail.com>
Closes #19095
DeltaFile
+6-5man/man4/spl.4
+0-3module/os/linux/spl/spl-kmem-cache.c
+6-82 files