OpenZFS/src 654e762lib/libzpool Makefile.am, module Kbuild.in Makefile.bsd

u8_textprep: move into module/zfs

Now that it's built into the main zfs module in all cases, there's no
reason to put it in its own dir.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #18071
DeltaFile
+0-2,171module/unicode/u8_textprep.c
+2,171-0module/zfs/u8_textprep.c
+1-6module/Kbuild.in
+1-3module/Makefile.bsd
+1-2lib/libzpool/Makefile.am
+2,174-2,1825 files

OpenZFS/src 309006alib Makefile.am, lib/libunicode Makefile.am

libunicode: merge into libzpool

It's a single source file that is not used anywhere else, so there's no
reason to keep it separate.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #18071
DeltaFile
+0-6lib/libunicode/Makefile.am
+2-1lib/libzpool/Makefile.am
+0-1lib/Makefile.am
+2-83 files

OpenZFS/src 648a9a2.github/workflows zfs-qemu-packages.yml, .github/workflows/scripts qemu-test-repo-vm.sh

CI: Test 2.4.x in qemu-test-repo-vm.sh, quick mode

The qemu-test-repo-vm.sh script tests installs ZFS from different
repos.  Have it test from the new 2.4.x repos as well.

Also add a checkbox to run in "lookup mode".  This just does a
quick lookup to see what version is installed in each repo.  It does
not do a test install and module load.  It only takes 3min to run vs
over an hour for the full version.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18070
DeltaFile
+23-4.github/workflows/scripts/qemu-test-repo-vm.sh
+12-1.github/workflows/zfs-qemu-packages.yml
+35-52 files

OpenZFS/src af9ae62tests/zfs-tests/tests/functional/raidz raidz_001_neg.ksh

ZFS: Enable more logs for raidz_001_neg

The output is not so big here, so lets collect something useful.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17977
DeltaFile
+1-1tests/zfs-tests/tests/functional/raidz/raidz_001_neg.ksh
+1-11 files

OpenZFS/src e3fe429.github/workflows zfs-qemu-packages.yml, .github/workflows/scripts qemu-test-repo-vm.sh

CI: zfs-test-packages: Add in new repos

Test install from our new repos: zfs-latest, zfs-legacy,
zfs-2.3, zfs-2.2, from the zfs-test-packages workflow.
This on-demand workflow is use to verify that the zfs RPMs
in the repos are correct.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #17956
DeltaFile
+12-6.github/workflows/scripts/qemu-test-repo-vm.sh
+1-1.github/workflows/zfs-qemu-packages.yml
+13-72 files

OpenZFS/src 0afe9b6scripts commitcheck.sh

CI: exclude signed-off-by/reviewed-by from 72 char limit

Allow an author or reviewer's name and email address to exceed
the 72 character limit enforced by the commitcheck target.

Reviewed-by: RageLtMan <rageltman at sempervictus>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #18030
DeltaFile
+3-1scripts/commitcheck.sh
+3-11 files

OpenZFS/src 0dcb882module/os/linux/zfs abd_os.c

Fix interaction of abd_iter_map()/abd_iter_unmap() with HIGHMEM

HIGHMEM kmap interfaces operate on only a single page at a time
yet ZFS hadn't accounted for this, resulting in crashes and
potential memory corruption on HIGHMEM (typically 32-bit) systems.
This was caught by PaX's KERNSEAL feature as it makes use of
HIGHMEM functionality on x64.

On typical 64-bit systems, this issue wouldn't have been observed,
as the map interfaces simply fall back to returning an address in
lowmem where the contiguous pages can be accessed directly.

Joint work with the PaX Team, tested by Mark van Dijk

Reviewed-by: RageLtMan <rageltman at sempervictus>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: bspengler-oss <94915855+bspengler-oss at users.noreply.github.com>
Closes #15668
Closes #18030
DeltaFile
+15-2module/os/linux/zfs/abd_os.c
+15-21 files

OpenZFS/src 44e6a07include/os/freebsd/spl/sys mod_os.h, man/man4 zfs.4

ZIO: Set minimum number of free issue threads to 32

Free issue threads might block waiting for synchronous DDT, BRT or
GANG header reads. So unlike other taskqs using ZTI_SCALE to scale
with number of CPUs, here we also need some amount of threads to
potentially saturate pool reads.  I am not sure we always want the
96 threads we had before ZTI_SCALE introduction at #11966 on small
systems, but lets make it at least 32.

While here, make free taskqs configurable, similar to read and
write ones.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17903
DeltaFile
+86-18module/zfs/spa.c
+38-0man/man4/zfs.4
+3-0include/os/freebsd/spl/sys/mod_os.h
+127-183 files

OpenZFS/src 08d34f2lib/libzfs libzfs_status.c

Suppress some ashift warnings

Do not warn about vdev ashifts being smaller then physical ashifts
in a pool status if the pool ashift property set and vdev ashift
satisfies it (bigger or equal), since user explicitly requested
this.  The ashift of individual vdevs are still reported.

Do not warn about vdev ashifts in zpool import, since it doesn't
matter much, and we don't even report individual vdevs ashifts
there.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Allan Jude <allan at klarasystems.com>
Reviewed-by: Rob Norris <rob.norris at klarasystems.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17830
DeltaFile
+43-35lib/libzfs/libzfs_status.c
+43-351 files

OpenZFS/src 23d4ce6cmd/raidz_test raidz_test.c raidz_test.h

raidz_test: Set io_offset reasonably

 - io_offset of 1 makes no sense.  Set default to 0.
 - Initialize io_offset in all cases.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17977
DeltaFile
+1-1cmd/raidz_test/raidz_test.c
+1-1cmd/raidz_test/raidz_test.h
+2-22 files

OpenZFS/src 4f77b30module/os/linux/zfs zfs_uio.c

Fix HIGHMEM/kmap API violation in zfs_uiomove_bvec_impl()

Fix another instance where ZFS assumes multiple pages can be
mapped at once via zfs_kmap_local(), resulting in crashes and
potential memory corruption on HIGHMEM-enabled (typically 32-bit)
systems.

Reviewed-by: RageLtMan <rageltman at sempervictus>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: bspengler-oss <94915855+bspengler-oss at users.noreply.github.com>
Closes #15668
Closes #18030
DeltaFile
+6-4module/os/linux/zfs/zfs_uio.c
+6-41 files

OpenZFS/src c87a1f7cmd/raidz_test raidz_test.c

raidz_test: Restore rand_data protection

It feels dirty to modify protection of a memory allocated via libc,
but at least we should try to restore it before freeing.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17977
DeltaFile
+2-0cmd/raidz_test/raidz_test.c
+2-01 files

OpenZFS/src b2d052ecmd/raidz_test raidz_test.c

raidz_test: Fix ZIO ABDs initialization

 - When filling ABDs of several segments, consider offset.
 - "Corrupt" ABDs with actually different data to fail something.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17977
DeltaFile
+16-3cmd/raidz_test/raidz_test.c
+16-31 files

OpenZFS/src 00ab445.github/workflows zfs-qemu-packages.yml zfs-qemu.yml

CI: Change timeout values

The 'Setup QEMU' CI step updates and installs all packages necessary to
startup QEMU.  Typically the step takes a little over a minute, but
we've seen cases where it can take legitimately take more than 45min
minutes.  Change the timeout to 60 minutes.

In addition, change the 'Install dependencies' timeout to 60min since
we've also seen timeouts there.

Lastly, remove all timeouts from the zfs-qemu-packages workflow.
We do this so that we can always build packages from a branch, even if
the time it takes to do a CI step changes over time.  It's ok to
eliminate the timeouts from the zfs-qemu-packages completely since that
workflow is only run manually.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18056
DeltaFile
+0-5.github/workflows/zfs-qemu-packages.yml
+2-2.github/workflows/zfs-qemu.yml
+2-72 files

OpenZFS/src e51c8c0tests/zfs-tests/include libtest.shlib

CI: Fix Ubuntu 22.01 rsend failures

For whatever reason, the single `log_note` in the `directory_diff`
function causes the function to stop executing on Ubuntu 22.  This
causes most of the rsend tests to fail.  Remove the line since it's only
informational.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18032
DeltaFile
+0-2tests/zfs-tests/include/libtest.shlib
+0-21 files

OpenZFS/src e35fdeb.github/workflows/scripts qemu-1-setup.sh

CI: Use Ubuntu mirrors instead of azure (#18057)

Use the official Ubuntu apt mirrors instead of
azure.archive.ubuntu.com, since that mirror can be slow:

    https://github.com/actions/runner-images/issues/7048

This can help speed up the 'Setup QEMU' stage.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18057
DeltaFile
+14-0.github/workflows/scripts/qemu-1-setup.sh
+14-01 files

OpenZFS/src 4458796module/zfs abd.c

Preserve LIFO ordering of kmap ops in abd_raidz_gen_iterate()

ZFS typically preserves proper LIFO ordering regarding map/unmap
operations that wrap the Linux kernel's kmap interfaces that
require such ordering, but one instance in abd_raidz_gen_iterate()
did not.

Similar issues have been fixed in the Linux kernel in the past,
see for instance CVE-2025-39899 for userfaultfd.

Reviewed-by: RageLtMan <rageltman at sempervictus>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: bspengler-oss <94915855+bspengler-oss at users.noreply.github.com>
Closes #15668
Closes #18030
DeltaFile
+8-8module/zfs/abd.c
+8-81 files

OpenZFS/src 1397bf1cmd/zpool zpool_vdev.c

Explicit set ashift for non-leaf vdevs

Before this change ashift property was applied only to a leaf
vdevs.  As result, it worked only as a minimal value for parent
vdevs, since bigger physical_ashift value reported by any child
could be used instead when deciding parent's ashift, as if the
ashift property was never set.

This change explicitly passes ZPOOL_CONFIG_ASHIFT to all vdevs,
allowing override for parents only if the passed value is below
logical_ashift and so unacceptable.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Allan Jude <allan at klarasystems.com>
Reviewed-by: Rob Norris <rob.norris at klarasystems.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17826
DeltaFile
+33-31cmd/zpool/zpool_vdev.c
+33-311 files

OpenZFS/src 0d44b58lib/libshare nfs.c, lib/libshare/os/linux nfs.c smb.c

libshare: fold into libzfs and reorg headers a little

libzfs is the only user of libshare, and only internally, so there's no
particular reason to build it separately, nor to export its symbols. So,
pull it into libzfs proper, remove its "public" header, and hide its
symbols.

The bare minimum "public" API is just to count and enumerate the
supported share types. These are moved to libzfs.h with the other share
API.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #18072
DeltaFile
+0-587lib/libshare/os/linux/nfs.c
+585-0lib/libzfs/os/linux/libzfs_share_nfs.c
+218-222lib/libzfs/libzfs.abi
+0-407lib/libshare/os/linux/smb.c
+405-0lib/libzfs/os/linux/libzfs_share_smb.c
+0-318lib/libshare/nfs.c
+1,208-1,53421 files not shown
+2,237-2,34927 files

OpenZFS/src 962e688module/zfs dsl_scan.c spa.c

Use reduced precision for scan times

Scan time limits do not need precision beyond 1ms.  Switching
scn_sync_start_time and spa_sync_starttime from gethrtime() to
getlrtime() saves ~3% of CPU time during resilver scan stage.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18061
DeltaFile
+13-13module/zfs/dsl_scan.c
+1-1module/zfs/spa.c
+1-1module/zfs/spa_misc.c
+15-153 files

OpenZFS/src a83bb15man/man4 zfs.4, module/zfs dsl_scan.c

Reduce minimal scrub/resilver times

With higher throughput and lower latency of modern devices ZFS can
happily live with pretty short (fractions of a second) TXGs.  But
the two decade old multi-second minimal time limits can almost stop
payload writes by extending TXGs beyond dirty data limits of ARC
ability to amortize it.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18060
DeltaFile
+2-2man/man4/zfs.4
+2-2module/zfs/dsl_scan.c
+4-42 files

OpenZFS/src 7433349. META

Tag 2.4.0

Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
DeltaFile
+1-1META
+1-11 files

OpenZFS/src 2143bff.github/workflows zfs-qemu-packages.yml zfs-qemu.yml

CI: Change timeout values

The 'Setup QEMU' CI step updates and installs all packages necessary to
startup QEMU.  Typically the step takes a little over a minute, but
we've seen cases where it can take legitimately take more than 45min
minutes.  Change the timeout to 60 minutes.

In addition, change the 'Install dependencies' timeout to 60min since
we've also seen timeouts there.

Lastly, remove all timeouts from the zfs-qemu-packages workflow.
We do this so that we can always build packages from a branch, even if
the time it takes to do a CI step changes over time.  It's ok to
eliminate the timeouts from the zfs-qemu-packages completely since that
workflow is only run manually.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18056
DeltaFile
+0-5.github/workflows/zfs-qemu-packages.yml
+2-2.github/workflows/zfs-qemu.yml
+2-72 files

OpenZFS/src 1d43387cmd/zdb zdb.c, man/man8 zdb.8

zdb: Add -O option for -r to specify object-id

"zdb -r -O pool/dataset obj-id destination" will copy
the file with object-id obj-id to the named destination;
without -O it'll still be interpreted as a pathname.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Akash B <akash-b at hpe.com>
Signed-off-by: Sean Eric Fagan <sean.fagan at klarasystems.com>
Closes #16307
DeltaFile
+8-3cmd/zdb/zdb.c
+11-0man/man8/zdb.8
+19-32 files

OpenZFS/src 7ff329amodule/os/freebsd/zfs zfs_znode_os.c, module/os/linux/zfs zfs_znode_os.c

Fix rangelock test for growing block size

If the file already has more than one block, then the current
block size cannot change. But if the file block size is less
than the maximum block size supported by the file system, and
there are multiple blocks in the file, the current code will
almost always extend the rangelock to its maximum size.
This means that all writes become serialized and even reads
are slowed as they will more often contend with writes. This
commit adjusts the test so that we will not lock the entire
range if there is more than one block in the file already.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Mark Maybee <mark.maybee at perforce.com>
Closes #18046
Closes #18064
DeltaFile
+4-3module/os/freebsd/zfs/zfs_znode_os.c
+4-3module/os/linux/zfs/zfs_znode_os.c
+8-62 files

OpenZFS/src 051a8c7module/zfs zfs_quota.c

Bypass snprintf() in quota checks if no quotas set

This improves synthetic 1 byte write speed by ~2.5%.

Reviewed-by: Ameer Hamza <ahamza at ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18063
DeltaFile
+4-4module/zfs/zfs_quota.c
+4-41 files

OpenZFS/src 0550abdmodule/zfs vdev_raidz.c

RAIDZ: Remove some excessive logging

There were some per I/O logging into dbgmsg in RAIDZ code, that
increased CPU load and wiped useful content out of dbgmsg, for
example during routine disk replacement process.  I don't think
we need it to be that verbose.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18059
DeltaFile
+0-16module/zfs/vdev_raidz.c
+0-161 files

OpenZFS/src 51421ecmodule/os/linux/zfs abd_os.c

Linux 6.18: replace nth_page()

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn at despairlabs.com>
DeltaFile
+9-0module/os/linux/zfs/abd_os.c
+9-01 files

OpenZFS/src 8757506config kernel-writeback.m4 kernel-writepage_t.m4, module/os/linux/zfs zpl_file.c

Linux 6.18: replace write_cache_pages()

Linux 6.18 removed write_cache_pages() without a usable replacement.
Here we implement a minimal zpl_write_cache_pages() that find the dirty
pages within the mapping, gets them into the expected state and hands
them off to zfs_putpage(), which handles the rest.

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn at despairlabs.com>
DeltaFile
+74-0module/os/linux/zfs/zpl_file.c
+58-0config/kernel-writeback.m4
+0-26config/kernel-writepage_t.m4
+2-2config/kernel.m4
+134-284 files

OpenZFS/src a82b804config kernel-userns-capabilities.m4 kernel-namespace.m4, module/os/linux/spl spl-zone.c

Linux 6.18: namespace type moved to ns_common

The namespace type has moved from the namespace ops struct to the
"common" base namespace struct. Detect this and define a macro that does
the right thing for both versions.

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn at despairlabs.com>
DeltaFile
+0-79config/kernel-userns-capabilities.m4
+31-0config/kernel-namespace.m4
+18-1module/os/linux/spl/spl-zone.c
+2-0config/kernel.m4
+51-804 files