OpenZFS/src f3bf5f9.github/workflows/scripts qemu-3-deps-vm.sh

CI: install diffutils on the Alpine runner

ZTS calls cmp with skip offsets, and zfs_send_sparse does it against a
file whose hole doubles every round.  GNU cmp seeks to the offset;
busybox cmp reads its way there, 512 bytes at a time.  Timed per command
on the runner, the send stays flat while the compare doubles:

  hole     zfs send | zfs receive    cmp
  256MiB   0.07s                    25.2s
  512MiB   0.08s                    51.7s
  1GiB     0.07s                   102.1s

so the test walks into its ten minute cap, and the group's cleanup fails
behind it and takes the next groups' setup with it.

The GNU cmp comes from diffutils, which is not in this list -- without
it the busybox applet answers to cmp instead.  diffutils arrives on 3.24
only because something else happens to pull it in, so the runner works
by accident of the dependency graph rather than by asking for what it

    [4 lines not shown]
DeltaFile
+5-5.github/workflows/scripts/qemu-3-deps-vm.sh
+5-51 files

OpenZFS/src f4192d6lib/libzfs libzfs_sendrecv.c, man/man8 zfs-receive.8 zfs-send.8

libzfs: explain why a large-block stream mismatch happens

A receive fails with ZFS_ERR_STREAM_LARGE_BLOCK_MISMATCH when the
destination has large blocks and the stream does not carry them. The
error told the user to add -L, but -L cannot help when the sending
dataset has no large blocks of its own: setup_featureflags() sets
DMU_BACKUP_FEATURE_LARGE_BLOCKS only when the feature is active on the
sending dataset, so -L is silently a no-op there. That is the state a
dataset is left in by an earlier replication in the opposite direction
that ran without -L, which splits the large blocks and leaves the copy
without the feature. The two copies then have different block layouts,
and advising -L sends the user in a circle.

Reword the error to name both causes and the remedy, and document the
trap in zfs-send.8 and zfs-receive.8.

Add a test for the reverse direction, which was not covered: replicate
a dataset that has large blocks without -L, then send an incremental
back with -L and confirm it is rejected, that omitting -L fails the

    [11 lines not shown]
DeltaFile
+104-0tests/zfs-tests/tests/functional/rsend/send_large_blocks_reverse.ksh
+38-4man/man8/zfs-send.8
+23-0man/man8/zfs-receive.8
+9-2lib/libzfs/libzfs_sendrecv.c
+1-0tests/zfs-tests/tests/Makefile.am
+1-0tests/runfiles/common.run
+176-66 files

OpenZFS/src 2f29d25tests/zfs-tests/tests/functional/mount mount_loopback.ksh

ZTS: take the loop device name from losetup itself

mount_loopback attaches an image with "losetup -f" and then looks the
device up again with "losetup --associated".  Alpine's udev populates a
/dev/loop directory with the devices the kernel pre-creates at init, and
util-linux resolves every device name to /dev/loop/N whenever that
directory exists.  A device allocated beyond those, through
/dev/loop-control once the first eight are busy, has no node there and
is never found.  mkfs.xfs then runs with an empty argument and the test
aborts.

That is also why it is intermittent: it depends on how many loop devices
earlier tests left attached.

Aborting leaves the loop device holding the image open, so the pool
underneath cannot be unmounted and every later test that destroys a pool
fails too.

Ask losetup to print the device it attached instead, and fail loudly if

    [4 lines not shown]
DeltaFile
+6-3tests/zfs-tests/tests/functional/mount/mount_loopback.ksh
+6-31 files

OpenZFS/src c00228d.github/workflows/scripts qemu-3-deps-vm.sh

CI: stop cloud-init stalling every Alpine boot

The Alpine runner takes over five minutes to answer after the build step
reboots it, and all of it is one service:

    * cloud-init local ...Cloud-init v. 26.1 running 'init-local'
    DataSourceLXD.py[WARNING]: /dev/lxd/sock does not exist.
    <301 seconds>
     [ ok ]

Everything after it takes two seconds.  It is datasource detection
timing out on an LXD socket a libvirt guest will never have.

Three cloud-init services are already removed here, but the one that
stalls is cloud-init-local, which lives in the boot runlevel rather than
default and so was never touched.  Remove it too.  Cloud-init is still
needed on the first boot, where the ssh key arrives through it; this
runs after that.


    [2 lines not shown]
DeltaFile
+1-0.github/workflows/scripts/qemu-3-deps-vm.sh
+1-01 files

OpenZFS/src 74c0810tests/zfs-tests/tests/functional/cli_root/zpool_initialize zpool_initialize_multiple_pools.ksh

ZTS: Change zpool_initialize_multiple_pools devsize

Change zpool_initialize_multiple_pools test vdev sizes from
5GB -> 1GB.  This size reduction is important since the test creates
four vdevs of this size (20GB) and initializes them.   This
space reduction is need for running 3 CI VMs in parallel.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #19134
DeltaFile
+1-1tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_multiple_pools.ksh
+1-11 files

OpenZFS/src 5d6ce30tests/zfs-tests/tests/functional/cli_root/zpool_prefetch zpool_prefetch_001_pos.ksh

ZTS: Make zpool_prefetch_001_pos faster

zpool_prefetch_001 creates 16 thousand files, and makes copies of a
fraction of them.  This takes a long time, especially when run on the
slow CI VMs.

Make it faster by only creating 8k files, and do some of the creations
in parallel.  Both optimizations help to bring down the test time
from 40sec -> 14sec, as measured on a local, 10-core, VM.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #19133
DeltaFile
+19-13tests/zfs-tests/tests/functional/cli_root/zpool_prefetch/zpool_prefetch_001_pos.ksh
+19-131 files

OpenZFS/src 7636c39config zfs-build.m4 rpm.am, rpm/generic zfs-kmod.spec.in

rpm: Add support for building akmod packages

Add akmod (Automatic Kernel Module) support to ZFS, providing a third
packaging option alongside the existing DKMS and kmod packages.

Akmod packages automatically build binary kmod RPMs when new kernels
are installed, enabling:
- Automatic kernel module rebuilds on kernel updates
- Distribution of binary kmod RPMs without recompilation
- Seamless minor version upgrades on RHEL/Fedora and clones

Key changes:
- rpm/generic/zfs-kmod.spec.in: Add conditional akmod support via
  rpmbuild --define '_enable_akmod 1'. When enabled, sets
  buildforkernels=akmod and repo=rpmfusion so kmodtool generates
  an akmod-zfs package. Add -common subpackage for shared
  license/doc files. Guard chmod and %files sections for empty
  kernel_versions. Make kmod-devel packages opt-in via
  %bcond_with devel to prevent akmods from installing unnecessary

    [35 lines not shown]
DeltaFile
+32-19scripts/kmodtool
+35-6rpm/generic/zfs-kmod.spec.in
+15-5config/rpm.am
+3-3config/zfs-build.m4
+85-334 files

OpenZFS/src db78d8bcmd/zdb zdb.c, tests/runfiles common.run

zdb: account pending DDT-log frees in leak detection

With fast dedup, the last decref of a block lands in the DDT log, and
the physical free happens only when the log entry is flushed back into
the DDT. ddt_phys_decref() only decrements the in-memory refcount, the
log append path issues no free, and ddt_phys_free() -- the only caller
of zio_free() on this path -- runs from ddt_sync_flush_entry(). A pool
examined inside that window contains blocks that no block pointer
references but that are still allocated. zdb's leak detection never
enumerates the log, so it misreports those blocks: as "leaked space"
and a block traversal size mismatch in the generic accounting
(print-only since d63f5d7e50), and as a fatal "obsolete indirect
mapping count mismatch" when such a block sits behind a removed vdev's
indirect mapping -- which is what intermittently fails the zloop CI
job.

Count the phys that the flush will free the same way as the
deferred-free bplist, under a new "DDT pending free" bucket:
reconstruct the BP, clear the dedup bit exactly as ddt_phys_free()

    [40 lines not shown]
DeltaFile
+214-0tests/zfs-tests/tests/functional/dedup/dedup_log_zdb_leak.ksh
+67-3cmd/zdb/zdb.c
+1-0tests/zfs-tests/tests/Makefile.am
+1-0tests/runfiles/common.run
+283-34 files

OpenZFS/src c2108a3cmd/zdb zdb.c, tests/runfiles common.run

zdb: don't index an indirect vdev's metaslabs in the --class filter

zdb_count_block()'s --class filter resolves a block's allocation class
by indexing the top vdev's metaslab array. An indirect vdev, left
behind by a device removal, normally has no metaslabs; zdb synthesizes
them in zdb_leak_init_prepare_indirect_vdevs() so that zio_claim() has
somewhere to claim into. That only happens when leak tracking is
enabled, so under -L the array is NULL and any block whose first DVA
names a removed vdev dereferences it.

Classify an indirect vdev from its allocation bias instead. The bias
determines the vdev's primary metaslab group, and is available whether
or not the synthetic metaslabs exist.

For an indirect vdev with more than zfs_embedded_slog_min_ms metaslabs
this also changes what the filter reports. The synthetic metaslabs
carry no space maps, so they all look empty, and vdev_metaslab_init()
moves the emptiest into the embedded log group; blocks in that range
then classified as "other". Measured on a ztest pool with two removed

    [16 lines not shown]
DeltaFile
+73-0tests/zfs-tests/tests/functional/removal/removal_indirect_class.ksh
+45-15cmd/zdb/zdb.c
+2-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+121-164 files

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