OpenZFS/src 6ba51dacontrib/dracut/90zfs module-setup.sh.in

contrib: dracut: always include zfs kernel module

This commit fixes the issue and includes the zfs kernel
module even when dracut is used in hostonly mode.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Jo Zzsi <jozzsicsataban at gmail.com>
Closes #17754
DeltaFile
+1-1contrib/dracut/90zfs/module-setup.sh.in
+1-11 files

OpenZFS/src 545d662cmd/zfs zfs_main.c

Fix a printf format specifier on FreeBSD/i386

This is breaking the build on FreeBSD/i386.  Originally committed
downstream as https://github.com/freebsd/freebsd-src/commit/2d76470b701

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by:  Alan Somers <asomers at gmail.com>
Sponsored by:   ConnectWise
Closes #17705
DeltaFile
+4-4cmd/zfs/zfs_main.c
+4-41 files

OpenZFS/src 3387d34config always-compiler-options.m4 always-arch.m4, lib/libspl Makefile.am

Fix atomic-alignment warnings in libspl on FreeBSD/i386

On i386, Clang complains about misaligned atomic operations.  Silence
these warnings to fix the build on FreeBSD/i386.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by:  Alan Somers <asomers at gmail.com>
Sponsored by:   ConnectWise
Closes #17708
DeltaFile
+21-0config/always-compiler-options.m4
+3-0lib/libspl/Makefile.am
+1-0config/always-arch.m4
+1-0config/zfs-build.m4
+26-04 files

OpenZFS/src ab8cc63config kernel-dentry-operations.m4, include/os/linux/zfs/sys zpl.h

linux/super: add tunable to request immediate reclaim of unused dentries

Traditionally, unused dentries would be cached in the dentry cache until
the associated entry is no longer on disk. The cached dentry continues
to hold an inode reference, causing the inode to be pinned (see previous
commit).

Here we implement the dentry op d_delete, which is roughly analogous to
the drop_inode superblock op, and add a zfs_delete_dentry tunable to
control its behaviour. By default it continues the traditional
behaviour, but when the tunable is enabled, we signal that an unused
dentry should be freed immediately, releasing its inode reference, and
so allowing that inode to be deleted if no longer in use.

Sponsored-by: Klara, Inc.
Sponsored-by: Fastmail Pty Ltd
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17746
DeltaFile
+41-0module/os/linux/zfs/zpl_super.c
+25-0config/kernel-dentry-operations.m4
+22-0man/man4/zfs.4
+6-0module/os/linux/zfs/zfs_vfsops.c
+1-0include/os/linux/zfs/sys/zpl.h
+95-05 files

OpenZFS/src ab93b4bman/man4 zfs.4, module/os/linux/zfs zpl_super.c

linux/super: add tunable to request immediate reclaim of unused inodes

Traditionally, unused inodes would be held on the superblock inode cache
until the associated on-disk file is removed or the kernel requests
reclaim.  On filesystems with millions of rarely-used files, this can be
a lot of unusable memory.

Here we implement the superblock drop_inode method, and add a
zfs_delete_inode tunable to control its behaviour. By default it
continues the traditional behaviour, but when the tunable is enabled, we
signal that the inode should be deleted immediately when the last
reference is dropped, rather than cached. This releases the associated
data to the dbuf cache and ARC, allowing them to be reclaimed normally.

Sponsored-by: Klara, Inc.
Sponsored-by: Fastmail Pty Ltd
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17746
DeltaFile
+40-4module/os/linux/zfs/zpl_super.c
+22-1man/man4/zfs.4
+62-52 files

OpenZFS/src ffe93aetests/zfs-tests/tests/functional/cli_root/zhack library.kshlib

Add `typeset`s to `zhack label repair` test scripts

As a quality assurance measure, `typeset` is added to local variable
declarations to actually enforce their intended scope.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: buzzingwires <buzzingwires at outlook.com>
Closes #17732
DeltaFile
+30-23tests/zfs-tests/tests/functional/cli_root/zhack/library.kshlib
+30-231 files

OpenZFS/src 1d2d812cmd zhack.c, tests/zfs-tests/tests/functional/cli_root/zhack library.kshlib zhack_label_repair_001.ksh

Refactor `zhack label repair` and fix `-c` regression on nonzero TXG

This commit fixes a likely regression introduced by 64db435 where the
checksum repair functionality (`-c` or default behavior) will perform
checks and access data associated with the newer undetach (`-u`)
functionality, resulting in a failure when an uberblock's TXG is not 0
as required by `-u` but not `-c`

Additionally, code is refactored for better separation of tasks.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: buzzingwires <buzzingwires at outlook.com>
Closes #17732
DeltaFile
+78-56cmd/zhack.c
+23-6tests/zfs-tests/tests/functional/cli_root/zhack/library.kshlib
+9-6tests/zfs-tests/tests/functional/cli_root/zhack/zhack_label_repair_001.ksh
+110-683 files

OpenZFS/src d366842man Makefile.am

man: add silent rules for mancheck

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17747
DeltaFile
+14-3man/Makefile.am
+14-31 files

OpenZFS/src 45ac604scripts mancheck.sh

mancheck: allow single files

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17747
DeltaFile
+12-5scripts/mancheck.sh
+12-51 files

OpenZFS/src faf2db3config Shellcheck.am

Shellcheck.am: add silent rules for shellcheck and checkbashisms

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17747
DeltaFile
+10-2config/Shellcheck.am
+10-21 files

OpenZFS/src d147ed7.github/workflows/scripts qemu-2-start.sh

CI: Switch FreeBSD 15 to 15.0-ALPHA2

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

OpenZFS/src 58b8428include/sys dmu.h

Fix txg_log_time ZAP key typo

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Allan Jude <allan at klarasystems.com>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Igor Ostapenko <igor.ostapenko at klarasystems.com>
Sponsored-by: Klara, Inc.
Closes #17748
DeltaFile
+3-3include/sys/dmu.h
+3-31 files

OpenZFS/src 5c46baaman/man7 zfsprops.7

zfsprops(7): attempt to clarify the keylocation description

The current description is somewhat difficult to parse through, and in
some cases is a little unclear as to the behavior.

Split it into a paragraphs based on the three distinct behaviors you
may get: prompt, file URL, HTTP(S) URL.  The descriptions of the file
and HTTP(s) behavior seems fine, but prompt is a little vague- expand
on it and make it clear that the behavior is actively based on whether
the inquisitor of key-data is provided with a tty for stdin or not.

Also clarify *why* one shouldn't "place keys which should be kept secret
on the command line" and note that you *have* to supply the key via
stdin if it's a raw key, just to be sure.

Reviewed-by: Allan Jude <allan at klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Closes #17742
DeltaFile
+16-8man/man7/zfsprops.7
+16-81 files

OpenZFS/src f330b46tests/zfs-tests/include libtest.shlib, tests/zfs-tests/tests/functional/fault auto_replace_001_pos.ksh auto_replace_002_pos.ksh

ZTS: default to random data in fill_fs

Update the fill_fs helper function to request a random fill pattern
when the "data" argument isn't specified.  This ensures the default
behavior is to perform a more realistic fill of incompressible blocks.

Additionally, update a few test cases to specify a random fill.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17739
DeltaFile
+1-1tests/zfs-tests/include/libtest.shlib
+1-1tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh
+1-1tests/zfs-tests/tests/functional/fault/auto_replace_002_pos.ksh
+1-1tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh
+4-44 files

OpenZFS/src 4b764fbtests/runfiles common.run

ZTS: Fix zfs_send_delegation_user test

Correct the path in the common.run file.  The zfs_send_delegation_user
test is installed under cli_user not cli_root.

Reviewed-by: Allan Jude <allan at klarasystems.com>
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17740
DeltaFile
+2-2tests/runfiles/common.run
+2-21 files

OpenZFS/src f319ff3module/os/linux/zfs vdev_disk.c

vdev_disk_close: take disk write lock before destroying it

Many IO operations are submitted to the kernel async, and so the zio can
complete and followup actions before the submission call returns. If one
of the followup actions closes the disk (eg during pool create/import),
the initiator may be left holding a lock on the disk at destruction.

Instead, take the write lock before finishing up and decoupling the disk
state from the vdev proper. The caller will hold until all IO is
submitted and locks released.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17719
DeltaFile
+5-1module/os/linux/zfs/vdev_disk.c
+5-11 files

OpenZFS/src 3f4312amodule/zfs dmu.c

Fix two infinite loops if dmu_prefetch_max set to zero

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17692
Closes #17729
DeltaFile
+4-2module/zfs/dmu.c
+4-21 files

OpenZFS/src 9b772f3module/zfs zfs_crrd.c, tests/runfiles common.run

Fix time database update calculations

The time database update math assumed that the timestamps were in
nanoseconds, but at some point in the development or review process they
changed to seconds. This PR fixes the math to use seconds instead.
    
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #17735 
DeltaFile
+76-0tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_date_range_002.ksh
+2-2module/zfs/zfs_crrd.c
+1-1tests/runfiles/common.run
+1-0tests/zfs-tests/tests/Makefile.am
+1-0tests/zfs-tests/include/tunables.cfg
+81-35 files

OpenZFS/src 455c361tests/zfs-tests/tests/functional/refreserv refreserv_raidz.ksh

ZTS: refreserv/refreserv_raidz improvements

Several small changes intended to make this test reliable.

- Leave the default compression enabled for the pool and switch
  to using /dev/urandom as the data source.  Functionally this
  shouldn't impact the test but it's preferable to test with
  the pool defaults when possible.

- Verify the device is created and removed as required.  Switch
  to a unique volume name for a more clarity in the logs.

- Use the ZVOL_DEVDIR to specify the device path.

- Speed up the test by creating the pool with an ashift=12 and
  testing 4K, 8K, 128K volblocksizes.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17725
DeltaFile
+16-30tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh
+16-301 files

OpenZFS/src bc8bcfcmodule/zfs zfs_crrd.c

Fix type in dbrrd_closest()

For ABS() to work, the argument must be signed, but rrdd_time is
uint64_t.  Clang noticed it.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Mariusz Zaborski <mariusz.zaborski at klarasystems.com>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Fixes #16853
Closes #17733
DeltaFile
+2-1module/zfs/zfs_crrd.c
+2-11 files

OpenZFS/src cb5f9aamodule/os/freebsd/zfs zfs_znode_os.c zfs_vnops_os.c

FreeBSD: Satisfy ASSERT_VOP_IN_SEQC()

zfs_aclset_common() might be called for newly created or not even
created vnodes, that triggers assertions on newer FreeBSD versions
with DEBUG_VFS_LOCKS included into INVARIANTS.  In the first case
make sure to call vn_seqc_write_begin()/_end(), in the second just
skip the assertion.

The similar has to be done for project management IOCTL and file-
bases extended attributes, since those are not going through VFS.

Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17722
DeltaFile
+5-1module/os/freebsd/zfs/zfs_znode_os.c
+4-0module/os/freebsd/zfs/zfs_vnops_os.c
+1-1module/os/freebsd/zfs/zfs_acl.c
+10-23 files

OpenZFS/src 35f47cbtests/zfs-tests/tests/functional/cli_root/zhack zhack_metaslab_leak.ksh

Make new zhack test a little more reliable

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #17728
DeltaFile
+1-1tests/zfs-tests/tests/functional/cli_root/zhack/zhack_metaslab_leak.ksh
+1-11 files

OpenZFS/src 37cd30fmodule/zfs ddt_log.c

Fix ddle memleak in ddt_log_load

In ddt_log_load(), when removing dup entry from flushing tree, it doesn't
free the entry causing memleak.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Chunwei Chen <david.chen at nutanix.com>
Co-authored-by: Chunwei Chen <david.chen at nutanix.com>
Closes #17657
Closes #17730
DeltaFile
+11-7module/zfs/ddt_log.c
+11-71 files

OpenZFS/src 955fbc5tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation zfs_send_test.ksh setup.ksh, tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user zfs_send_usertest.ksh setup.ksh

Add send:encrypted test

Create tests for the new send:encrypted permission

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: JT Pennington <jt.pennington at klarasystems.com>
Closes #17543
DeltaFile
+145-0tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/zfs_send_usertest.ksh
+111-0tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/zfs_send_test.ksh
+50-0tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/setup.ksh
+50-0tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/setup.ksh
+43-0tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/cleanup.ksh
+43-0tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/cleanup.ksh
+442-02 files not shown
+456-08 files

OpenZFS/src 7b1cc9ecmd/zfs zfs_main.c, include zfs_deleg.h

ZFS allow send:encrypted

A new `zfs allow` permissions that ONLY allows sending replication
streams in raw (encrypted) mode, so encrypted data will not be
decrypted as part of the replication process.

Sponsored-by: Klara, Inc.
Sponsored-by: Karakun AG
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Co-authored-by: JT Pennington <jt.pennington at klarasystems.com>
Signed-off-by: Allan Jude <allan at klarasystems.com>
Closes #17543
DeltaFile
+15-2module/zfs/zfs_ioctl.c
+6-0cmd/zfs/zfs_main.c
+3-2man/man8/zfs-allow.8
+1-0module/zcommon/zfs_deleg.c
+1-0include/sys/dsl_deleg.h
+1-0include/zfs_deleg.h
+27-46 files

OpenZFS/src 654f2dccmd/zed zed_exec.c, cmd/zed/zed.d statechange-led.sh statechange-sync-led.sh

zed: Add synchronous zedlets

Historically, ZED has blindly spawned off zedlets in parallel and never
worried about their completion order.  This means that you can
potentially have zedlets for event number 2 starting before zedlets for
event number 1 had finished.  Most of the time this is fine, and it
actually helps a lot when the system is getting spammed with hundreds
of events.

However, there are times when you want your zedlets to be executed
in sequence with the event ID.  That is where synchronous zedlets
come in.

ZED will wait for all previously spawned zedlets to finish before
running a synchronous zedlet.  Synchronous zedlets are guaranteed to be
the only zedlet running.  No other zedlets may run in parallel with a
synchronous zedlet.  Users should be careful to only use synchronous
zedlets when needed, since they decrease parallelism.


    [11 lines not shown]
DeltaFile
+0-242cmd/zed/zed.d/statechange-led.sh
+242-0cmd/zed/zed.d/statechange-sync-led.sh
+149-0tests/zfs-tests/tests/functional/events/zed_synchronous_zedlet.ksh
+90-21cmd/zed/zed_exec.c
+0-71cmd/zed/zed.d/deadman-slot_off.sh
+71-0cmd/zed/zed.d/deadman-sync-slot_off.sh
+552-33412 files not shown
+666-41418 files

OpenZFS/src bc0b531module/zfs zfs_ioctl.c

Prevent scrubbing a read-only pool

While it would be nice to be able to scrub a pool imported read-only
this will currently trip an ASSERT.  Before we can support this there
are some designs challenges which need to be thought through first.

For starters, a read-only import skips reading certain information 
from disk which it knows won't be needed, such as the space maps.
Furthermore, the scrub process expects to be checkpoint it's progress, 
update the on disk error log, and issue repair IO.  None of which 
would be possible when the pool is imported read-only.  

Each of these wrinkles can certainly be handled, but that will take 
some signifcant work.  In the meanwhile we disable the 'zpool scrub' 
command when the pool is imported read-only.

Reviewed-by: Alan Somers <asomers at gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Issue #17527
Closes #17717 
DeltaFile
+1-1module/zfs/zfs_ioctl.c
+1-11 files

OpenZFS/src d64711cmodule/zfs vdev_raidz.c vdev.c, tests/zfs-tests/tests/functional/events slow_vdev_sit_out_neg.ksh slow_vdev_degraded_sit_out.ksh

Detect a slow raidz child during reads

A single slow responding disk can affect the overall read
performance of a raidz group.  When a raidz child disk is
determined to be a persistent slow outlier, then have it
sit out during reads for a period of time. The raidz group
can use parity to reconstruct the data that was skipped.

Each time a slow disk is placed into a sit out period, its
`vdev_stat.vs_slow_ios count` is incremented and a zevent
class `ereport.fs.zfs.delay` is posted.

The length of the sit out period can be changed using the
`raid_read_sit_out_secs` module parameter.  Setting it to
zero disables slow outlier detection.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>

    [4 lines not shown]
DeltaFile
+345-0module/zfs/vdev_raidz.c
+199-0tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh
+189-0tests/zfs-tests/tests/functional/replacement/attach_resilver_sit_out.ksh
+116-1module/zfs/vdev.c
+116-0tests/zfs-tests/tests/functional/events/slow_vdev_sit_out_neg.ksh
+106-0tests/zfs-tests/tests/functional/events/slow_vdev_degraded_sit_out.ksh
+1,071-122 files not shown
+1,399-1328 files

OpenZFS/src 0620c97module/zfs spa_misc.c, tests/zfs-tests/tests/functional/cli_root/zdb zdb_tunables.ksh

Remove RAIDZ reconstruct flags from debug defaults

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Closes #17227
DeltaFile
+3-3module/zfs/spa_misc.c
+1-1tests/zfs-tests/tests/functional/cli_root/zdb/zdb_tunables.ksh
+4-42 files

OpenZFS/src 7f7c583tests/zfs-tests/include libtest.shlib

ZTS: Print warning if running ZTS user_run test locally

Print a warning if you're attempting to run a ZTS test that calls
'user_run', and the ephemeral user doesn't have permissions to
access the test binaries.

This can happen if you're running ZTS from a local git repo.  In
that case the test user (say, 'testuser1') may need access to the
ZTS binaries in:

/home/<your_username>/zfs/tests/zfs-tests/bin/

... but 'testuser1' doesn't have permission to enter your home dir:

/home/<your_username>

The warning will help alert users to what is going on.  This will
not be an issue when ZTS is actually installed on the system
(via 'make install' or from packages).

    [3 lines not shown]
DeltaFile
+22-0tests/zfs-tests/include/libtest.shlib
+22-01 files