OpenZFS/src e269af1. META

Tag zfs-2.2.7

META file and changelog updated.

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

OpenZFS/src 299da6alib/libzfs libzfs_util.c

Fix race in libzfs_run_process_impl

When replacing a disk, a child process is forked to run a script called
zfs_prepare_disk (which can be useful for disk firmware update or health
check). The parent than calls waitpid and checks the child error/status
code.

However, the _reap_children thread (created from zed_exec_process to
manage zedlets) also waits for all children with the same PGID and can
stole the signal, causing the replace operation to be aborted.

As waitpid returns -1, the parent incorrectly assume that the child
process had an error or was killed. This, in turn, leaves the newly
added disk in REMOVED or UNAVAIL status rather than completing the
replace process.

This patch changes the PGID of the child process execuing the
prepare script, shielding it from the _reap_children thread.


    [4 lines not shown]
DeltaFile
+1-0lib/libzfs/libzfs_util.c
+1-01 files

OpenZFS/src 02e73c5config kernel-register_sysctl_table.m4

Linux: Fix detection of register_sysctl_sz

Adjust the m4 function to mimic sentinel we use in spl-proc.c
This fixes the detection on kernels compiled with CONFIG_RANDSTRUCT=y

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Pavel Snajdr <snajpa at snajpa.net>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Ivan Volosyuk <Ivan.Volosyuk at gmail.com>
Closes: #16620
Closes: #16805
DeltaFile
+1-1config/kernel-register_sysctl_table.m4
+1-11 files

OpenZFS/src 0bd8481include/os/linux/zfs/sys zfs_vnops_os.h, module/os/linux/zfs zfs_vnops_os.c zpl_export.c

add get_name implementation for exports. (#16833)

This fixes a serious performance problem with NFS handling of large
directories, as the new get_name code is much more efficient than the
default zfs_readdir. This is actually part of
20232ecfaa34177bef6c08f2f1a55b8c8bd20da4 in 2.3. But I've taken only
the minimum code to implement get_name, and not the rest of the long
name changes.

Signed-off-by: Charles Hedrick <hedrick at rutgers.edu>
Co-authored-by: Charles L. Hedrick <hedrick at ncommunis.cs.rutgers.edu>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
DeltaFile
+42-0module/os/linux/zfs/zfs_vnops_os.c
+32-0module/os/linux/zfs/zpl_export.c
+1-0include/os/linux/zfs/sys/zfs_vnops_os.h
+75-03 files

OpenZFS/src a6e1cd1. META

Linux 6.12 compat: META

Update the META file to reflect compatibility with the 6.12 kernel.

Reviewed-by: Umer Saleem <usaleem at ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #16793 
DeltaFile
+1-1META
+1-11 files

OpenZFS/src 2bba6e3module/zfs dbuf.c

BRT: Don't call brt_pending_remove() on holes/embedded

We are doing exactly the same checks around all brt_pending_add().

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Pawel Jakub Dawidek <pjd at FreeBSD.org>
Reviewed-by: Brian Atkinson <batkinson at lanl.gov>
Signed-off-by: Alexander Motin <mav at FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16740
DeltaFile
+5-2module/zfs/dbuf.c
+5-21 files

OpenZFS/src 1f5e1b9include/sys dbuf.h

Pack dmu_buf_impl_t by 16 bytes

On 64bit FreeBSD this reduces one from 296 to 280 bytes.  On small
block workloads dbufs may consume gigabytes of ARC, and this saves
5% of it.

Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Reviewed-by: Brian Atkinson <batkinson at lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by:  Alexander Motin <mav at FreeBSD.org>
Sponsored by:   iXsystems, Inc.
Closes #16684 
DeltaFile
+24-29include/sys/dbuf.h
+24-291 files

OpenZFS/src 1c7b70btests/zfs-tests/tests/functional/bclone bclone_prop_sync.ksh

ZTS: Avoid embedded blocks in bclone/bclone_prop_sync

If we write less than 113 bytes with enabled compression we get
embeded block, which then fails check for number of cloned blocks
in bclone_test.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Pawel Jakub Dawidek <pjd at FreeBSD.org>
Reviewed-by: Brian Atkinson <batkinson at lanl.gov>
Signed-off-by: Alexander Motin <mav at FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16740
DeltaFile
+6-2tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh
+6-21 files

OpenZFS/src 0f86fccmodule/os/linux/zfs zpl_super.c

Linux: Fix zfs_prune panics

by protecting against sb->s_shrink eviction on umount with newer kernels

deactivate_locked_super calls shrinker_free and only then
sops->kill_sb cb, resulting in UAF on umount when trying
to reach for the shrinker functions in zpl_prune_sb of
in-umount dataset

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Adam Moss <c at yotes.com>
Signed-off-by: Pavel Snajdr <snajpa at snajpa.net>
Closes #16770
DeltaFile
+12-1module/os/linux/zfs/zpl_super.c
+12-11 files

OpenZFS/src 384b53bmodule/os/freebsd/zfs arc_os.c

FreeBSD: Add missing memory reclamation accounting

Signed-off-by:  Alexander Motin <mav at FreeBSD.org>
Sponsored by:   iXsystems, Inc.

Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Reviewed-by: Umer Saleem <usaleem at ixsystems.com>
Reviewed-by: Ameer Hamza <ahamza at ixsystems.com>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
DeltaFile
+5-1module/os/freebsd/zfs/arc_os.c
+5-11 files

OpenZFS/src 84ad1d5module/os/freebsd/zfs zfs_znode_os.c

FreeBSD: restore zfs_znode_update_vfs()

I accidentally removed this in c22d56e3e, and didn't notice because it
doesn't fail the build, but does fail to load into the kernel because it
can't link it.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16554 
DeltaFile
+12-0module/os/freebsd/zfs/zfs_znode_os.c
+12-01 files

OpenZFS/src 9e7af55include/os/freebsd/spl/sys debug.h, include/os/linux/spl/sys debug.h

Add custom debug printing for your asserts

Being able to print custom debug information on assert trip
seems useful.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Paul Dagnelie <pcd at delphix.com>
Signed-off-by: Rich Ercolani <rincebrain at gmail.com>
Closes #15792 
DeltaFile
+135-17include/os/linux/spl/sys/debug.h
+137-12include/os/freebsd/spl/sys/debug.h
+97-0lib/libspl/include/assert.h
+3-2module/zfs/arc.c
+372-314 files

OpenZFS/src 1ba5b2elib/libshare/os/freebsd nfs.c, lib/libspl/os/freebsd mnttab.c

freebsd: remove __FBSDID macro use

With FreeBSD's switch to git the $FreeBSD$ string is no longer expanded
and they have mostly been removed upstream.  Stop using __FBSDID and
remove the no-longer needed sys/cdefs.h includes.

Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Brooks Davis <brooks.davis at sri.com>
Closes #15527 
DeltaFile
+0-3module/os/freebsd/spl/spl_atomic.c
+0-3lib/libshare/os/freebsd/nfs.c
+0-3lib/libspl/os/freebsd/mnttab.c
+0-3lib/libzfs/os/freebsd/libzfs_zmount.c
+0-3module/os/freebsd/spl/spl_acl.c
+0-3module/os/freebsd/spl/spl_dtrace.c
+0-1819 files not shown
+0-7525 files

OpenZFS/src ba4e582include/os/freebsd/spl/sys misc.h, module/os/freebsd/spl spl_misc.c

FreeBSD: Add const qualifier to members of struct opensolaris_utsname

These members have directly references to the global variables
exposed by the kernel. They are not going to be changed by this
kernel module.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Zhenlei Huang <zlei at FreeBSD.org>
Closes #16210 
DeltaFile
+5-5include/os/freebsd/spl/sys/misc.h
+3-4module/os/freebsd/spl/spl_misc.c
+8-92 files

OpenZFS/src fc60e0cinclude/os/freebsd/linux compiler.h, include/os/freebsd/spl/sys ccompat.h debug.h

freebsd: Use compiler.h from FreeBSD's base's linuxkpi

The FreeBSD linux/compiler.h in OpenZFS was copied from a very old
version of FreeBSD's linuxkpi's linux/compiler.h. There's no need for
this duplication. Use FreeBSD's linuxkpi version instead, and provide
zfs_fallthrough to augment it (it's all that's needed). Use #pragma once
to avoid naming issues for guard variables. Since this is a complete
rewrite, use my copyright here (the original code in FreeBSD still
credits everybody). This works back at least to FreeBSD 12.4, which
is not out of support, and all newer releases.

Remove extra copies of macros that were defined elsewhere, but are now
properly defined in LinuxKPI so are redundant.

Sponsored-by: Netflix
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Warner Losh <imp at bsdimp.com>
Closes #16650
DeltaFile
+8-75include/os/freebsd/linux/compiler.h
+0-9include/os/freebsd/spl/sys/ccompat.h
+0-4include/os/freebsd/spl/sys/debug.h
+8-883 files

OpenZFS/src 9978315include/os/linux/kernel/linux vfs_compat.h

Linux 6.12: FMODE_UNSIGNED_OFFSET is now FOP_UNSIGNED_OFFSET

torvalds/linux at 641bb4394f40 asserts that this is a static flag, not
intended to be variable per-file, so it moves it to
file_operations instead. We just change our check to follow.

No configure check is necessary because FOP_UNSIGNED_OFFSET didn't exist
before this commit, and FMODE_UNSIGNED_OFFSET flag is removed in the
same commit, so there's no chance of a conflict.

It's not clear to me that we need this check at all, as we never set
this flag on our own files, and I can't see any way that our llseek
handler could recieve a file from another filesystem. But, the whole
zpl_llseek() has a number of opportunities for pleasing cleanup that are
nothing to do with this change, so I'll leave that for a future change.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16582
DeltaFile
+4-0include/os/linux/kernel/linux/vfs_compat.h
+4-01 files

OpenZFS/src dbc70ecconfig kernel-file.m4 kernel.m4, include/os/linux/kernel/linux vfs_compat.h

Linux 6.12: f_version removed from struct file

linux/torvalds at 11068e0b64cb removes it, suggesting this was a always
there as a helper to handle concurrent seeks, which all filesystems now
handle themselves if necessary.

Without looking into the mechanism, I can imagine how it might have been
used, but we have always set it to zero and never read from it,
presumably because we've always tracked per-caller position through the
znode anyway. So I don't see how there can be any functional change for
us by removing it. I've stayed conservative though and left it in for
older kernels, since its clearly not hurting anything there.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16582
DeltaFile
+31-0config/kernel-file.m4
+2-0include/os/linux/kernel/linux/vfs_compat.h
+2-0config/kernel.m4
+35-03 files

OpenZFS/src 08192d1config kernel-kthread.m4, module/os/linux/spl spl-thread.c

Linux 6.12: support 3arg dequeue_signal() without task param

See torvalds/linux at a2b80ce87a87. It claims the task arg is always
`current`, and so it is with us, so this is a safe change to make. The
only spanner is that we also support the older pre-5.17 3-arg
dequeue_signal() which had different meaning, so we have to check the
types to get the right one.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16582
DeltaFile
+30-7config/kernel-kthread.m4
+10-8module/os/linux/spl/spl-thread.c
+40-152 files

OpenZFS/src 63f70d3module/os/freebsd/zfs zfs_debug.c, module/os/linux/zfs zfs_debug.c

zfs_dbgmsg_print: make FreeBSD and Linux consistent

FreeBSD was using fprintf(), which might not be signal-safe. Meanwhile,
Linux's locking did not cover the header output. This two quirks are
unrelated, but both have the same response: be like the other one. So
with this commit, both functions are the same except for the names of
their lock and list variables.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #16181
DeltaFile
+20-4module/os/freebsd/zfs/zfs_debug.c
+2-1module/os/linux/zfs/zfs_debug.c
+22-52 files

OpenZFS/src c31b18binclude/os/linux/spl/sys kmem_cache.h

Linux 6.12: avoid kmem_cache_create redefinition

torvalds/linux at b2e7456b5c25 makes kmem_cache_create() a macro, which
gets in the way of our our own redefinition, so we undef the macro first
for our own clients. This follows what we did for kmem_cache_alloc(),
see e951dba48.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16582
DeltaFile
+1-0include/os/linux/spl/sys/kmem_cache.h
+1-01 files

OpenZFS/src 01e06edconfig kernel-mm-page-flags.m4 kernel.m4, include/os/linux/kernel/linux mm_compat.h

Linux 6.12: PG_error flag was removed

torvalds/linux at 09022bc196d2 removes the flag, and the corresponding
SetPageError() and ClearPageError() macros, with no replacement offered.

Going back through the upstream history, use of this flag has been
gradually removed over the last year as part of the long tail of
converting everything to folios. Interesting tidbit comments from
torvalds/linux at 29e9412b250e and torvalds/linux at 420e05d0de18 suggest that
this flag has not been used meaningfully since page writeback failures
started being recorded in errseq_t instead (the whole "fsyncgate" thing,
~2017, around torvalds/linux at 8ed1e46aaf1b).

Given that, it's possible that since perhaps Linux 4.13 we haven't been
getting anything by setting the flag. I don't know if that's true and/or
if there's something we should be doing instead, but my gut feel is that
its probably fine we only use the page cache as a proxy to allow mmap()
to work, rather than backing IO with it.


    [8 lines not shown]
DeltaFile
+24-0config/kernel-mm-page-flags.m4
+14-0include/os/linux/kernel/linux/mm_compat.h
+2-0config/kernel.m4
+1-0module/os/linux/zfs/zfs_znode_os.c
+41-04 files

OpenZFS/src e580b54module Makefile.bsd, module/os/freebsd/zfs zfs_znode.c zfs_znode_os.c

zfs_znode: lift common code to a single shared file

For now, userspace has no znode implementation. Some of the property and
path handling code is used there though and is the same on all
platforms, so we only need a single copy of it.

Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #16492
DeltaFile
+0-2,338module/os/linux/zfs/zfs_znode.c
+0-2,214module/os/freebsd/zfs/zfs_znode.c
+1,974-0module/os/linux/zfs/zfs_znode_os.c
+1,833-0module/os/freebsd/zfs/zfs_znode_os.c
+397-0module/zfs/zfs_znode.c
+2-1module/Makefile.bsd
+4,206-4,5533 files not shown
+4,211-4,5559 files

OpenZFS/src dbeb509include/sys vdev.h

[zfs-2.2.7] Add vdev_check_boot_reserve() to vdev.h

Add vdev_check_boot_reserve() to vdev.h for zfs-2.2.7 compatibility.

Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
DeltaFile
+1-0include/sys/vdev.h
+1-01 files

OpenZFS/src 4982943lib/libzpool zfs_debug.c vdev_label_os.c, module/os/freebsd/zfs zfs_debug.c

zfs_debug: specific variant for userspace

Just nice and simple, with room to grow.

Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #16492
DeltaFile
+106-0lib/libzpool/zfs_debug.c
+0-40module/os/linux/zfs/zfs_debug.c
+1-37module/os/freebsd/zfs/zfs_debug.c
+9-3lib/libzpool/vdev_label_os.c
+2-2lib/libzpool/Makefile.am
+118-825 files

OpenZFS/src 16266b4cmd ztest.c, cmd/zdb zdb.c

zdb/ztest: send dbgmsg output to stderr

And, make the output fd an arg to zfs_dbgmsg_print(). This is a change
in behaviour, but keeps it consistent with where crash traces go, and
it's easy to argue this is what we want anyway; this is information
about the task, not the actual output of the task.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #16181
DeltaFile
+12-13module/os/freebsd/zfs/zfs_debug.c
+9-10module/os/linux/zfs/zfs_debug.c
+2-2cmd/ztest.c
+2-2cmd/zdb/zdb.c
+1-1include/sys/zfs_debug.h
+26-285 files

OpenZFS/src d845820include/os/freebsd/zfs/sys abd_os.h abd_impl_os.h, include/os/linux/zfs/sys abd_os.h abd_impl_os.h

abd_os: break out platform-specific header parts

Removing the platform #ifdefs from shared headers in favour of
per-platform headers. Makes abd_t much leaner, among other things.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #16253
DeltaFile
+62-0include/os/linux/zfs/sys/abd_os.h
+47-0lib/libzpool/include/sys/abd_os.h
+46-0include/os/freebsd/zfs/sys/abd_os.h
+41-0include/os/linux/zfs/sys/abd_impl_os.h
+41-0include/os/freebsd/zfs/sys/abd_impl_os.h
+41-0lib/libzpool/include/sys/abd_impl_os.h
+278-08 files not shown
+294-4814 files

OpenZFS/src 0dee309include zfs_valstr.h, include/sys zio_priority.h zio_impl.h

value strings: pretty printers for flags and enums

This adds zfs_valstr, a collection of pretty printers for bitfields and
enums. These are useful in debugging, logging and other display contexts
where raw values are difficult for the untrained (or even trained!) eye
to decipher.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
DeltaFile
+277-0module/zcommon/zfs_valstr.c
+84-0include/zfs_valstr.h
+51-0lib/libzfs/libzfs.abi
+4-0include/sys/zio_priority.h
+3-0include/sys/zio_impl.h
+3-0include/sys/zio.h
+422-05 files not shown
+427-011 files

OpenZFS/src 56a82c6config kernel-blk-queue.m4, include/os/linux/kernel/linux blkdev_compat.h

config: remove HAVE_BLK_QUEUE_FLAG_*

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16479
DeltaFile
+0-50config/kernel-blk-queue.m4
+0-15include/os/linux/kernel/linux/blkdev_compat.h
+0-652 files

OpenZFS/src 9601eeeconfig kernel-blk-queue.m4, include/os/linux/kernel/linux blkdev_compat.h

config: remove HAVE_BLK_MQ

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16479
DeltaFile
+7-31config/kernel-blk-queue.m4
+0-36include/os/linux/kernel/linux/blkdev_compat.h
+1-33module/os/linux/zfs/zvol_os.c
+0-6module/os/linux/zfs/zfs_uio.c
+8-1064 files

OpenZFS/src 517d491config kernel-wait.m4 kernel.m4, include/os/linux/spl/sys wait.h taskq.h

config: remove HAVE_WAIT_QUEUE_*

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #16479
DeltaFile
+0-68config/kernel-wait.m4
+2-11module/os/linux/spl/spl-proc.c
+0-8include/os/linux/spl/sys/wait.h
+3-3include/os/linux/spl/sys/taskq.h
+2-2include/os/linux/spl/sys/condvar.h
+0-3config/kernel.m4
+7-951 files not shown
+8-967 files