OpenZFS/src 733f048man/man8 zpool-scrub.8

man: thorough scrub documentation update

Drop the paragraph in the -t option description which details the
resume behavior.  This is already covered under the -p option and
there's no need to belabor the point.

Reviewed-by: Alek Pinchuk <Alek.Pinchuk at connectwise.com>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #18797
DeltaFile
+0-12man/man8/zpool-scrub.8
+0-121 files

OpenZFS/src 14f4288tests/runfiles freebsd.run, tests/test-runner/bin zts-report.py.in

ZTS/block_cloning: test `COPY_FILE_RANGE_CLONE` on FreeBSD 15+

FreeBSD 15 gained a "clone only, never copy" flag for copy_file_range().
This implements it as an option in clonefile, so we can get the test
suite checking it.

Copying the existing FICLONERANGE tests, and changing the clonefile
call to use the copy_file_range(COPY_FILE_RANGE_CLONE) mode available
to ensure correct behaviour on FreeBSD 15.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Christos Longros <chris.longros at gmail.com>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18788
DeltaFile
+69-12tests/zfs-tests/cmd/clonefile.c
+70-0tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_clone_partial.ksh
+62-0tests/zfs-tests/tests/functional/block_cloning/block_cloning_copyfilerange_clone.ksh
+56-0tests/zfs-tests/tests/functional/block_cloning/block_cloning_disabled_copyfilerange_clone.ksh
+6-0tests/test-runner/bin/zts-report.py.in
+6-0tests/runfiles/freebsd.run
+269-121 files not shown
+272-127 files

OpenZFS/src 8f8db7bmodule/os/linux/zfs zfs_vfsops.c

zfs_sync: remove support for impossible scenarios

The superblock pointer will always be set, as will z_log, so remove code
supporting cases that can't occur (on Linux at least).

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit 52352dd74869d64070e784573d4a01bb55924017)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+14-27module/os/linux/zfs/zfs_vfsops.c
+14-271 files

OpenZFS/src 52a5c52module/os/linux/zfs zfs_vfsops.c

zfs_sync: return error when pool suspends

If the pool is suspended, we'll just block in zil_commit(). If the
system is shutting down, blocking wouldn't help anyone. So, we should
keep this test for now, but at least return an error for anyone who is
actually interested.

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit e3f5e317e0ed4da44a10fe202ec80abed1c8cc87)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+4-3module/os/linux/zfs/zfs_vfsops.c
+4-31 files

OpenZFS/src b836cce. configure.ac, tests/runfiles linux.run

zts: test syncfs() behaviour when pool suspends

Fairly coarse, but if it returns while the pool suspends, it must be
with an error.

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit c1b7bc52fe264bf8b96dd667ef55db3bd478c00a)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+116-0tests/zfs-tests/tests/functional/syncfs/syncfs_suspend.ksh
+4-0tests/runfiles/linux.run
+3-0tests/zfs-tests/tests/functional/syncfs/Makefile.am
+1-0tests/zfs-tests/tests/functional/Makefile.am
+1-0configure.ac
+125-05 files

OpenZFS/src dde78d1config kernel-sb-wb-err.m4 kernel.m4, module/os/linux/zfs zpl_super.c

zpl_sync_fs: work around kernels that ignore sync_fs errors

If the kernel will honour our error returns, use them. If not, fool it
by setting a writeback error on the superblock, if available.

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit d1c88cbd4cc2ebe5b97fa5b39e7fd83294583ed8)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+56-1module/os/linux/zfs/zpl_super.c
+27-0config/kernel-sb-wb-err.m4
+2-0config/kernel.m4
+85-13 files

OpenZFS/src 05af2c8tests/runfiles linux.run, tests/zfs-tests/tests Makefile.am

zts: test syncfs() behaviour when pool suspends

Fairly coarse, but if it returns while the pool suspends, it must be
with an error.

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit c1b7bc52fe264bf8b96dd667ef55db3bd478c00a)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+116-0tests/zfs-tests/tests/functional/syncfs/syncfs_suspend.ksh
+4-0tests/runfiles/linux.run
+1-0tests/zfs-tests/tests/Makefile.am
+121-03 files

OpenZFS/src 6ca4868module/os/linux/zfs zfs_vfsops.c

zfs_sync: remove support for impossible scenarios

The superblock pointer will always be set, as will z_log, so remove code
supporting cases that can't occur (on Linux at least).

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit 52352dd74869d64070e784573d4a01bb55924017)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+13-29module/os/linux/zfs/zfs_vfsops.c
+13-291 files

OpenZFS/src 0167bcbconfig kernel-sb-wb-err.m4 kernel.m4, module/os/linux/zfs zpl_super.c

zpl_sync_fs: work around kernels that ignore sync_fs errors

If the kernel will honour our error returns, use them. If not, fool it
by setting a writeback error on the superblock, if available.

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit d1c88cbd4cc2ebe5b97fa5b39e7fd83294583ed8)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+56-1module/os/linux/zfs/zpl_super.c
+27-0config/kernel-sb-wb-err.m4
+2-0config/kernel.m4
+85-13 files

OpenZFS/src 6dff9ebmodule/os/linux/zfs zfs_vfsops.c

zfs_sync: return error when pool suspends

If the pool is suspended, we'll just block in zil_commit(). If the
system is shutting down, blocking wouldn't help anyone. So, we should
keep this test for now, but at least return an error for anyone who is
actually interested.

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>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17420
(cherry picked from commit e3f5e317e0ed4da44a10fe202ec80abed1c8cc87)
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
DeltaFile
+4-3module/os/linux/zfs/zfs_vfsops.c
+4-31 files

OpenZFS/src 91ab7d5.github/workflows zfs-qemu.yml, .github/workflows/scripts qemu-2-start.sh qemu-3-deps-vm.sh

CI: Update Alpine Linux runner to 3.24.1

Update the Alpine Linux CI runner from 3.23.2 to 3.24.1.

This refreshes the runner to the latest Alpine release while keeping
the existing CI configuration unchanged.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Moch <mail at alexmoch.com>
Closes #18790
DeltaFile
+3-3.github/workflows/scripts/qemu-2-start.sh
+1-1.github/workflows/zfs-qemu.yml
+1-1.github/workflows/scripts/qemu-3-deps-vm.sh
+5-53 files

OpenZFS/src d63f140lib/libzutil zutil_import.c zutil_import.h, lib/libzutil/os/freebsd zutil_import_os.c

libzutil: keep valid spare and l2cache paths on import

Unlike the vdev tree, whose paths are read from the scanned labels
and whose label paths are added to the candidate name list (so the
exact match in fix_paths() preserves a persistent name whenever its
symlink is still alive), spare and l2cache configs are obtained from
the pool's MOS by a tryimport.  When the on-disk aux label carries
no path (labels last written before eb4a36bce) or a stale one, the
MOS path never appears among the scanned names and fix_paths()
rewrites it to the best scanned candidate.  With the default
libblkid discovery that is the bare /dev basename, which is not
stable across reboots.  Since 5536c0dee ("Sync AUX label during pool
import") the rewritten path is also synced back to the MOS and the
aux labels, making the reversion permanent.

This is the remaining piece of #13170, where a cache device added by
a /dev/disk/by-* name comes back as e.g. nvme0n1p4 after an export
and import.  It also answers the question raised there about #15817:
that change fixed the reversion for aux vdevs whose labels contain a

    [28 lines not shown]
DeltaFile
+123-0tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_aux_paths.ksh
+95-3lib/libzutil/zutil_import.c
+73-11lib/libzutil/os/freebsd/zutil_import_os.c
+52-11lib/libzutil/os/linux/zutil_import_os.c
+2-0lib/libzutil/zutil_import.h
+1-1tests/runfiles/linux.run
+346-261 files not shown
+347-267 files

OpenZFS/src 3390f3e.github PULL_REQUEST_TEMPLATE.md

Remove libuutil from the pull request template and fix headings

- libuutil was removed in adb316f41.
- Normalize section headers to title case.
- Drop the trailing colon on "Checklist".

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Alexander Moch <mail at alexmoch.com>
Closes #18791
DeltaFile
+3-3.github/PULL_REQUEST_TEMPLATE.md
+3-31 files

OpenZFS/src 52424e4tests/unit test_sha2.c Makefile.am

unit/sha2: test SHA-256, SHA-512 and SHA-512/256

NIST known answers, split updates across the 64- and 128-byte block
boundaries, and cross-implementation equality via zfs_impl_get_ops().
Check SHA-256 and SHA-512 against the one-million-'a' digests based
on the NIST standard.

Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18779
DeltaFile
+329-0tests/unit/test_sha2.c
+16-1tests/unit/Makefile.am
+1-0tests/unit/.gitignore
+346-13 files

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

ZTS: fix zpool_initialize_multiple_pools suspend race

zpool_initialize_multiple_pools verifies that "zpool initialize -a -s"
suspends initializing on all four pools. It starts initializing and,
without slowing it down, expects every pool to still be initializing
when the suspend runs.

On fast storage a pool can finish initializing before the suspend, so
"zpool initialize -a -s" reports "there is no active initialization"
and the pool's status is "completed" rather than "suspended". The
suspend command then fails the test intermittently.

Throttle zfs_initialize_chunk_size before the suspend phase, the same
way the zpool_wait_initialize_* tests do, so initializing stays active
through the suspend and cancel checks. The earlier phases that wait for
initializing to finish ("zpool wait" and "-w -a") are left at the
default chunk size so they still complete promptly.

The chunk size is saved and restored, and the pools are destroyed

    [5 lines not shown]
DeltaFile
+19-1tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_multiple_pools.ksh
+19-11 files

OpenZFS/src 6ad9c3f.github/workflows/scripts qemu-6-tests.sh

CI: Fix race caused by shared ctr file updates

CTR is shared between the VMs and used as a global counter.  This 
uncoordinated shared access can result in a CI failure due to the
racing updates.  From the log:

`qemu-6-tests.sh: line 27: 1`
`6: syntax error in expression
(error token is "6")`

Resolve the issue by using separate ctr files by appending the ID.
The output now prints the total test cases count along with each VMs
individual count.

Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: tiehexue <tiehexue at hotmail.com>
Closes #18778
DeltaFile
+15-7.github/workflows/scripts/qemu-6-tests.sh
+15-71 files

OpenZFS/src 63385edconfig kernel-idmap_mnt_api.m4 kernel.m4, module/os/linux/zfs zpl_super.c

config: remove HAVE_IDMAP_MNT_API check

The check itself is not needed, since we only use it to decide whether
or not to use a define, we can just test the define anyway.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-25config/kernel-idmap_mnt_api.m4
+0-2config/kernel.m4
+1-1module/os/linux/zfs/zpl_super.c
+1-283 files

OpenZFS/src d09f952config kernel-acl.m4, module/os/linux/zfs zpl_inode.c

config/acl: narrow checks to userns inode->dentry change

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+9-25config/kernel-acl.m4
+1-1module/os/linux/zfs/zpl_inode.c
+10-262 files

OpenZFS/src 889966cconfig kernel-mkdir.m4, module/os/linux/zfs zpl_ctldir.c zpl_inode.c

config/mkdir: narrow checks to dentry return

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+3-3config/kernel-mkdir.m4
+2-2module/os/linux/zfs/zpl_ctldir.c
+2-2module/os/linux/zfs/zpl_inode.c
+7-73 files

OpenZFS/src 98addf6config kernel-tmpfile.m4, module/os/linux/zfs zpl_inode.c

config/tmpfile: narrow checks to userns dentry->file change

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+18-50config/kernel-tmpfile.m4
+6-6module/os/linux/zfs/zpl_inode.c
+24-562 files

OpenZFS/src 61cb6c7config kernel-xattr-handler.m4 kernel-mkdir.m4

config: remove obsolete idmap/userns checks

Everything has been converted to the new helpers built on the "global"
idmap/userns checks, so we can get rid of all the individual function
checks.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-91config/kernel-xattr-handler.m4
+0-84config/kernel-mkdir.m4
+0-81config/kernel-inode-create.m4
+0-68config/kernel-inode-getattr.m4
+0-66config/kernel-inode-setattr.m4
+0-64config/kernel-is_owner_or_cap.m4
+0-4547 files not shown
+4-79913 files

OpenZFS/src 5c99c3ainclude/os/linux/kernel/linux xattr_compat.h

xattr: use generic checks for ZPL_XATTR_SET_WRAPPER selection

We can't (yet) replace these wrappers but we can use the generic checks
as selector, obsoleting more configure checks.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+3-22include/os/linux/kernel/linux/xattr_compat.h
+3-221 files

OpenZFS/src 1f9f7f6include/os/linux/kernel/linux vfs_compat.h, module/os/linux/zfs zfs_acl.c

zpl_generic_permission: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-0include/os/linux/kernel/linux/vfs_compat.h
+1-6module/os/linux/zfs/zfs_acl.c
+14-62 files

OpenZFS/src c13174ainclude/os/linux/kernel/linux vfs_compat.h, include/os/linux/zfs/sys zpl.h

zpl_inode_owner_or_capable: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-0include/os/linux/kernel/linux/vfs_compat.h
+0-12module/os/linux/zfs/zpl_xattr.c
+0-10include/os/linux/zfs/sys/zpl.h
+13-223 files

OpenZFS/src 9b89e2finclude/os/linux/kernel/linux vfs_compat.h, include/os/linux/zfs/sys zpl.h

zpl_setattr_prepare: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+13-0include/os/linux/kernel/linux/vfs_compat.h
+0-10include/os/linux/zfs/sys/zpl.h
+0-6module/os/linux/zfs/zpl_inode.c
+13-163 files

OpenZFS/src 5d83dfainclude/os/linux/kernel/linux vfs_compat.h, module/os/linux/zfs zpl_ctldir.c zfs_vnops_os.c

zpl_generic_fillattr: generic over idmap style

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+3-40module/os/linux/zfs/zpl_ctldir.c
+17-22include/os/linux/kernel/linux/vfs_compat.h
+1-4module/os/linux/zfs/zfs_vnops_os.c
+21-663 files

OpenZFS/src 0b6b2e9include/os/linux/zfs/sys zfs_vnops_os.h, module/os/linux/zfs zpl_inode.c zpl_ctldir.c

zfs_getattr_fast: single version

The caller always has an idmap of some sort, so we can just call it directly.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-6module/os/linux/zfs/zpl_inode.c
+0-6module/os/linux/zfs/zpl_ctldir.c
+0-4include/os/linux/zfs/sys/zfs_vnops_os.h
+0-4module/os/linux/zfs/zfs_vnops_os.c
+0-204 files

OpenZFS/src 0897997module/os/linux/zfs zpl_inode.c

zfs_setattr_idmap: always use idmap version

We added zfs_setattr_idmap in dee19fae05; just use it for all cases now
that we always have an idmap available.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+0-6module/os/linux/zfs/zpl_inode.c
+0-61 files

OpenZFS/src 0011703include/os/linux/kernel/linux vfs_compat.h, module/os/linux/zfs zpl_ctldir.c zpl_inode.c

zpl_inode: use ZPL_IDMAP_IOP_DEFINE for getattr/setattr callbacks

ZPL_GETATTR_WRAPPER and ZPL_SETATTR_WRAPPER were earlier concept of
these defines that didn't actually do enough. Since these are just
regular inode_operations callbacks, we can use ZPL_IDMAP_IOP_DEFINE for
those too and remove the old wrappers.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+9-42module/os/linux/zfs/zpl_ctldir.c
+5-24module/os/linux/zfs/zpl_inode.c
+0-28include/os/linux/kernel/linux/vfs_compat.h
+14-943 files

OpenZFS/src e436d60module/os/linux/zfs zpl_inode.c zpl_ctldir.c

zpl_inode: use ZPL_IDMAP_IOP_DEFINE for iops callbacks

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18769
DeltaFile
+39-117module/os/linux/zfs/zpl_inode.c
+8-31module/os/linux/zfs/zpl_ctldir.c
+47-1482 files