OpenZFS/src 5d33801lib/libzfs libzfs_crypto.c

get_key_material_https: label 'kfdok' defined but not used

The label 'kfdok' is only used with O_TMPFILE, we need to use
the same #ifdef around this label.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Toomas Soome <tsoome at me.com>
Closes #17894
DeltaFile
+2-0lib/libzfs/libzfs_crypto.c
+2-01 files

OpenZFS/src d0294aamodule/zfs dnode.c

Update dnode_next_offset_level to accept blkid instead of offset

Currently this function uses L0 offsets which:
1. is hard to read since it maps offsets to blkid and back each call
2. necessitates dnode_next_block to handle edge cases at limits
3. makes it hard to tell if the traversal can loop infinitely

Instead, update this and dnode_next_offset to work in (blkid, index).
This way the blkid manipulations are clear, and it's also clear that
the traversal always terminates since blkid goes one direction.

I've also considered updating dnode_next_offset to operate on blkid.
Callers use both patterns, so maybe another PR can split the cases?

While here tidy up dnode_next_offset_level comments.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Robert Evans <evansr at google.com>
Closes #17792
DeltaFile
+68-88module/zfs/dnode.c
+68-881 files

OpenZFS/src a90f816. README.md

Fix capitalization typo in README.md

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Sivesh Kumar <siveshjami at gmail.com>
Closes #17889
DeltaFile
+1-1README.md
+1-11 files

OpenZFS/src 6cfc3dbmodule/os/freebsd/zfs vdev_label_os.c, module/zfs vdev_label.c

Cleanup ZIO_FLAG_IO_RETRY vs TRYHARD usage

In cases where all issued ZIOs must succeed, and we can't do
anything clever about the errors, we should just explicitly set
ZIO_FLAG_TRYHARD and let OS to do all the reasonable retries.

In other cases, where retries can be different from the original,
for example, some ZIOs are allowed to fail due to redundancy, or
we can disable aggregation on retrial to get at least some of
the data, we can do first pass without TRYHARD, and only if needed
retry with ZIO_FLAG_IO_RETRY (which implies TRYHARD semantics).

Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17877
DeltaFile
+12-21module/zfs/vdev_label.c
+2-6module/os/freebsd/zfs/vdev_label_os.c
+14-272 files

OpenZFS/src ec268cdinclude/sys dmu.h, module/zfs ddt_log.c brt.c

Fix caching of DDT log and BRT

Both DDT log and BRT counters we read on pool import and then only
append or overwrite in full blocks.  We don't need them in DMU or
ARC caches.  Fortunately we have DMU_UNCACHEDIO for this now.

Even more we don't need BRT in non-evictable metadata DMU caches,
since it will likely never fit there, while block the cache from
its original users.  Since DMU_OT_IS_METADATA_CACHED() has no way
to differentiate the new metadata types, mark BRT with storage
type of DMU_OT_DDT_ZAP.  As side effect it will also put it on
dedup device, but that should actually be right.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17875
DeltaFile
+4-3module/zfs/ddt_log.c
+4-2module/zfs/brt.c
+4-1module/zfs/dbuf.c
+1-1include/sys/dmu.h
+13-74 files

OpenZFS/src ea125eemodule/zfs brt.c

BRT: Round bv_entcount up to BRT_BLOCKSIZE

Since we set bv_mos_brtvdev block size, and since we keep dirty
bitmap at the same granularity, we should keep the allocations
and writes done with.  Otherwise it makes the last block write
short, that will be odd once we implement writing of only dirty
blocks, but also requires read-modify-write on DMU layer.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17875
DeltaFile
+7-8module/zfs/brt.c
+7-81 files

OpenZFS/src 033dbdc. autogen.sh

autogen.sh: remove workaround for automake <1.14, needed for EL <=7

Ultimately this is a revert of 779ac93, which according to
@nabijaczleweli is to paper over automake <1.14's lack of
%reldir% support.

As I understand it, EL8 is the lowest current build target.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Joseph Holsten <joseph at josephholsten.com>
Closes #17878
DeltaFile
+1-60autogen.sh
+1-601 files

OpenZFS/src f819b41scripts zfs2zol-patch.sed zol2zfs-patch.sed

Retire ZoL patch scripts

Remove the out of date helper scripts originally used to port
Illumos commits to the ZoL repository.  Due to layout changes
made to this repository they're no longer entirely correct.
Remove them to make it clear they're no longer being used or
actively maintained.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17880
DeltaFile
+0-32scripts/zfs2zol-patch.sed
+0-20scripts/zol2zfs-patch.sed
+1-3scripts/Makefile.am
+1-553 files

OpenZFS/src dcada08cmd ztest.c, include/sys dmu.h

Pass flags to more DMU write/hold functions

Over the time many of DMU functions got flags argument to control
prefetch, caching, etc.  Few functions though left without it, even
though closer look shown that many of them do not require prefetch
due to their access pattern.  This patch adds the flags argument to
dmu_write(), dmu_buf_hold_array() and dmu_buf_hold_array_by_bonus(),
passing DMU_READ_NO_PREFETCH where applicable.

I am going to also pass DMU_UNCACHEDIO to some of them later.

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 #17872
DeltaFile
+11-11module/zfs/dmu.c
+10-5cmd/ztest.c
+6-3module/zfs/bptree.c
+5-3module/zfs/metaslab.c
+4-3module/zfs/bpobj.c
+3-3include/sys/dmu.h
+39-2815 files not shown
+69-4721 files

OpenZFS/src 3caf66cman/man8 zpool-events.8

man: Update zpool-event subclass names and document new types

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Quartz <yyhran at 163.com>
Closes #17868
DeltaFile
+55-18man/man8/zpool-events.8
+55-181 files

OpenZFS/src 67e7163tests/zfs-tests/tests/functional/trim autotrim_config.ksh

ZTS: autotrim_config.ksh is missing pool type

functional/trim tests do create pools of different types to test
trim, autotrim_config.ksh is missing the type from zpool
create command line while we are looping over different pool
types.

Sponsored-by: Edgecast Cloud LLC.
Signed-off-by: Toomas Soome <tsoome at me.com>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17874
DeltaFile
+1-1tests/zfs-tests/tests/functional/trim/autotrim_config.ksh
+1-11 files

OpenZFS/src 0455150module/os/freebsd/zfs zio_crypt.c

FreeBSD zio_crypt.c: initialize uio variables before access

In zio_crypt_key_wrap and zio_crypt_key_unwrap, the cuio_s variable was
not initialized before the calls to zfs_uio_init, leading to
uninitialized access to cuio_s.uio_offset.  Initialize it to avoid gcc
warnings.

Similar issue as fixed in 2bf152021 ("Fix gcc uninitialized warning in
FreeBSD zio_crypt.c")

Signed-off-by: Ryan Libby <rlibby at FreeBSD.org>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17863
DeltaFile
+2-0module/os/freebsd/zfs/zio_crypt.c
+2-01 files

OpenZFS/src fc519b2. AUTHORS .mailmap

mailmap/AUTHORS: update with recent new contributors

We’re not always on the same page, but at least we’re in the same book.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17860
DeltaFile
+14-0AUTHORS
+8-0.mailmap
+22-02 files

OpenZFS/src 4470461cmd/zpool zpool_main.c

zpool: fix conflict with -v and -o options

Right now, the -v and -o options for `zpool list` work independently,
but when paired, the -v "wins out" and the -o effect is lost. This
commit fixes that problem.

Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Shreshth Srivastava <shreshthsrivastava2 at gmail.com>
Closes #11040
Closes #17839
DeltaFile
+91-42cmd/zpool/zpool_main.c
+91-421 files

OpenZFS/src 72f4145scripts zfs-tests.sh, tests/test-runner/bin test-runner.py.in

ZTS: fail test run if test runner crashes unexpectedly

zfs-tests.sh executes test-runner.py to do the actual test work. Any
exit code < 4 is interpreted as success, with the actual value
describing the outcome of the tests inside.

If a Python program crashes in some way (eg an uncaught exception), the
process exit code is 1.

Taken together, this means that test-runner.py can crash during setup,
but return a "success" error code to zfs-tests.sh, which will report and
exit 0. This in turn causes the CI runner to believe the test run
completed successfully.

This commit addresses this by making zfs-tests.sh interpret an exit code
of 255 as a failure in the runner itself. Then, in test-runner.py, the
"fail()" function defaults to a 255 return, and the main function gets
wrapped in a generic exception handler, which prints it and calls
fail().

    [10 lines not shown]
DeltaFile
+19-14tests/test-runner/bin/test-runner.py.in
+4-0scripts/zfs-tests.sh
+23-142 files

OpenZFS/src 814f9af. META

Tag 2.4.0-rc3

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

OpenZFS/src 6f6e1c9module/os/freebsd/zfs zfs_vnops_os.c

FreeBSD: zfs_getpages: Don't zero freshly allocated pages

Initially, `zfs_getpages()` is provided with an array of busy pages by
the vnode pager. It then tries to acquire the range lock, but if there
is a concurrent `zfs_write()` running and fails to acquire that range
lock, it "unbusies" the pages to avoid a deadlock with `zfs_write()`.
After that, it grabs the pages again and retries to acquire the range
lock, and so on.

Once it got the range lock, it filters out valid pages, then copy DMU
data to the remaining invalid pages.

The problem is that freshly allocated zero'd pages it grabbed itself are
marked as valid. Therefore they are skipped by the second part of the
function and DMU data is never copied to these pages. This causes mapped
pages to contain zeros instead of the expected file content.

This was discovered while working on RabbitMQ on FreeBSD. I could
reproduce the problem easily with the following commands:

    [21 lines not shown]
DeltaFile
+13-1module/os/freebsd/zfs/zfs_vnops_os.c
+13-11 files

OpenZFS/src 005c631config 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 3378a32.github/workflows/scripts qemu-2-start.sh

CI: Fix FreeBSD 15.0 by staying on ALPHA4 due to broken ALPHA5 image

FreeBSD 15.0-ALPHA5 image fails to boot on cloud VMs due to missing
/boot/efi mount point, causing the system to drop to single user mode
where SSH cannot start. Work around this by staying on ALPHA4 and
setting IGNORE_OSVERSION=yes to bypass pkg's kernel version mismatch
prompt during bootstrap. This allows CI to proceed with ALPHA4 until we
have a stable FreeBSD 15.0 image.

Signed-off-by: Ameer Hamza <ahamza at ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17846
DeltaFile
+1-1.github/workflows/scripts/qemu-2-start.sh
+1-11 files

OpenZFS/src 3e7e19ecmd/zpool zpool_iter.c, include libzfs.h

pool_iter_refresh: don't refresh pools twice

In "all pools" mode, pool_iter_refresh() will call zpool_iter(), which
will call zpool_refresh_stats() before calling add_pool(). If we already
have the pool, this is a different handle, so we just release it and
return. Back in pool_iter_refresh(), we then call zpool_stats_refresh()
again for our handle on the same pool.

All together, this means we're doing two ZFS_IOC_POOL_STATS calls into
the kernel for every pool in the system. This isn't wrong, but it does
double the pressure on global locks.

Instead, we add a new function zpool_refresh_stats_from_handle() that
simply copies the pool config and state from one handle to another, and
use it to update our handle before we release it in add_pool(), so we
only have one call per pool per interval.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.

    [4 lines not shown]
DeltaFile
+38-134lib/libzfs/libzfs.abi
+1-104lib/libuutil/libuutil.abi
+1-104lib/libzfs_core/libzfs_core.abi
+17-0lib/libzfs/libzfs_config.c
+2-0cmd/zpool/zpool_iter.c
+2-0include/libzfs.h
+61-3426 files

OpenZFS/src ead0fb7cmd/zinject zinject.c, include/sys zfs_ioctl.h zio.h

zinject: Introduce ready delay fault injection

This adds a pause to the ZIO pipeline in the ready stage for
matching I/O (data, dnode, or raw bookmark).

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Akash B <akash-b at hpe.com>
Signed-off-by: Robert Evans <evansr at google.com>
Closes #17787
DeltaFile
+70-11cmd/zinject/zinject.c
+38-0module/zfs/zio_inject.c
+14-0man/man8/zinject.8
+10-0module/zfs/zio.c
+1-0include/sys/zfs_ioctl.h
+1-0include/sys/zio.h
+134-116 files

OpenZFS/src c0d63f5.github/ISSUE_TEMPLATE feature_request.md, contrib/intel_qat readme.md

docs: fix a few small typos (#17804)

Signed-off-by: Shreshth Srivastava <shreshthsrivastava2 at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
DeltaFile
+1-1etc/init.d/README.md
+1-1.github/ISSUE_TEMPLATE/feature_request.md
+1-1contrib/intel_qat/readme.md
+3-33 files

OpenZFS/src 3fb2411module/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 b9356f0cmd/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 9050ecb.github/workflows zfs-qemu.yml, .github/workflows/scripts qemu-2-start.sh

CI: Switch FreeBSD 15 to 15.0-ALPHA4 and add FreeBSD 16

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs at mcmilk.de>
Closes #17815 
DeltaFile
+8-1.github/workflows/scripts/qemu-2-start.sh
+1-1.github/workflows/zfs-qemu.yml
+9-22 files

OpenZFS/src cf9163fcmd/zdb zdb.c

zdb: adjust block histogram binning strategy

Previously, a bin included all blocks _starting_ from given size
(e.g., a "4K" bin would include all blocks within the [4K; 8K) region).
This is counter-intuitive and does not match the typical use-case of the
block histogram (that is, to estimate disk usage considering how ZFS'
block allocation works). In other words, if I'm looking at the "4K" row,
I'm interested in records that _fit into_ a 4K block.

Adjust the binning strategy such that a bin includes all blocks _up to_
given size, such that e.g. a "4K" bin would include all blocks within
the (2K; 4K] region.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
Closes #16999
DeltaFile
+6-1cmd/zdb/zdb.c
+6-11 files

OpenZFS/src 250e2eccmd/zdb zdb.c

zdb: factor out block histogram bin number computation

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
Closes #16999
DeltaFile
+10-6cmd/zdb/zdb.c
+10-61 files

OpenZFS/src aeff239config kernel-drop-inode.m4 kernel.m4, include/os/linux/kernel/linux vfs_compat.h

Linux 6.18: generic_drop_inode() and generic_delete_inode() renamed

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn at despairlabs.com>
DeltaFile
+24-0config/kernel-drop-inode.m4
+7-0include/os/linux/kernel/linux/vfs_compat.h
+3-1module/os/linux/zfs/zpl_super.c
+2-0config/kernel.m4
+36-14 files

OpenZFS/src 49f0789module/os/linux/zfs zvol_os.c

Linux 6.18: convert ida_simple_* calls

ida_simple_get() and ida_simple_remove() are removed in 6.18. However,
since 4.19 they have been simple wrappers around ida_alloc() and
ida_free(), so we can just use those directly.

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn at despairlabs.com>
DeltaFile
+6-6module/os/linux/zfs/zvol_os.c
+6-61 files

OpenZFS/src 799bda7module/zfs zvol.c

Fix return value for setting zvol threading

We must return -1 instead of ENOENT if the special zvol threading
property set function can't locate the dataset (this would typically
happen with an encypted and unmounted zvol) so that the operation
gets inserted properly into the nvlist for operations to set. This
is because we want the property to be set once the zvol is
decrypted again.

Reviewed-by: Allan Jude <allan at klarasystems.com>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Ameer Hamza <ahamza at ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Andrew Walker <awalker at ixsystems.com>
Closes #17836
DeltaFile
+1-1module/zfs/zvol.c
+1-11 files