OpenZFS/src 06c73cf.github/workflows smatch.yml

CI: Add smatch static analysis workflow

Smatch is an actively maintained kernel-aware static analyzer
for C with a low false positive rate.  Since the code checker
can be run relatively quickly against the entire OpenZFS code
base (15 min) it makes sense to add it as a GitHub Actions
workflow.  Today smatch reports a significant numbers warnings
so the workflow is configured to always pass as long as the
analysis was run.  The results are available for reference.
Long term it would ideal to resolve all of the errors/warnings
at which point the workflow can be updated to fail when new
problems are detected.

Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Toomas Soome <tsoome at me.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17935
DeltaFile
+52-0.github/workflows/smatch.yml
+52-01 files

OpenZFS/src 74b50a7config deb.am, contrib/debian control Makefile.am

libuutil: remove packaging

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17934
DeltaFile
+0-29rpm/generic/zfs.spec.in
+2-22contrib/debian/control
+9-10config/deb.am
+0-2contrib/debian/Makefile.am
+0-2contrib/debian/openzfs-libuutil3.docs
+0-1contrib/debian/clean
+11-661 files not shown
+11-677 files

OpenZFS/src adb316finclude libuutil.h libuutil_impl.h, lib/libuutil libuutil.abi uu_list.c

libuutil: remove the whole thing

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17934
DeltaFile
+0-3,360lib/libuutil/libuutil.abi
+0-723lib/libuutil/uu_list.c
+0-569lib/libuutil/uu_avl.c
+0-327include/libuutil.h
+0-255lib/libuutil/uu_misc.c
+0-157include/libuutil_impl.h
+0-5,39114 files not shown
+11-5,79120 files

OpenZFS/src 871fa61cmd/zed/agents zfs_diagnosis.c, cmd/zfs zfs_main.c

zfs: replace uu_list with sys/list

Lets just use the list implementation we use everywhere else.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17934
DeltaFile
+27-50cmd/zed/agents/zfs_diagnosis.c
+20-42cmd/zfs/zfs_main.c
+47-922 files

OpenZFS/src b593748cmd/zfs zfs_main.c zfs_iter.c, cmd/zpool zpool_iter.c

zfs: replace uu_avl with sys/avl

Lets just use the AVL implementation we use everywhere else.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17934
DeltaFile
+107-215cmd/zfs/zfs_main.c
+35-94lib/libzfs/libzfs_changelist.c
+20-51lib/libzfs/libzfs_config.c
+21-42cmd/zpool/zpool_iter.c
+21-35cmd/zfs/zfs_iter.c
+1-3lib/libzfs/libzfs_impl.h
+205-4401 files not shown
+205-4427 files

OpenZFS/src e63d026cmd/zpool zpool_main.c zpool_vdev.c

cmd/zpool cstyle issues

add missing headers.
usage() is no-return, so anything after call to it is unreachable code.
use (void) cast where we do ignore return value.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Toomas Soome <tsoome at me.com>
Closes #17885
DeltaFile
+224-187cmd/zpool/zpool_main.c
+4-4cmd/zpool/zpool_vdev.c
+228-1912 files

OpenZFS/src ab38521. META

Tag zfs-2.3.5

META file and changelog updated.

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

OpenZFS/src 12d3e1fmodule/os/freebsd/zfs zfs_znode_os.c zfs_acl.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
+1-1module/os/freebsd/zfs/zfs_acl.c
+6-22 files

OpenZFS/src 099f69f. META

Tag 2.4.0-rc4

Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
DeltaFile
+1-1META
+1-11 files

OpenZFS/src 7a919fblib/libuutil libuutil.abi, lib/libzfs libzfs.abi

Update all ABI files

Refresh all ABI files using the CI generated files to reflect
the library interfaces to be published for the 2.4 release.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17911
DeltaFile
+6-74lib/libzfs/libzfs.abi
+1-69lib/libzfs_core/libzfs_core.abi
+0-69lib/libuutil/libuutil.abi
+1-1lib/libzfsbootenv/libzfsbootenv.abi
+8-2134 files

OpenZFS/src 5714090lib/libspl/include/sys tunables.h

libspl: hide zfs_tunable_* symbols

The zfs_tunable_* functions are a public interface which are
part of the internal libspl convenience library.  They should
be hidden to prevent an unnecessary ABI change in installed
libraries which link against libspl (e.g. libzfs_core, libuutil).

We do already leak long standing libspl symbols.  This commit is
solely intended to prevent leaking these new ones until this is
properly sorted out.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17911
DeltaFile
+7-5lib/libspl/include/sys/tunables.h
+7-51 files

OpenZFS/src 5b2489cconfig deb.am, contrib/debian control Makefile.am

Bump SONAME of libzfs and libzpool

The ABI of libzfs and libzpool have breaking changes since the
last major release.  Bump the SONAME for the upcoming 2.4 release
branch to libzfs7 and libzpool7.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17911
DeltaFile
+23-21rpm/generic/zfs.spec.in
+13-13contrib/debian/control
+4-4config/deb.am
+4-4contrib/debian/Makefile.am
+2-2contrib/debian/clean
+2-0contrib/debian/openzfs-libzfs7.install.in
+48-449 files not shown
+55-5315 files

OpenZFS/src ff536b1lib/libnvpair Makefile.am

Bump SONAME on libnvpair

The nvlist_snprintf() function was added to the ABI of libnvpair.
No other symbols were modified or removed.  Bump the library-info
SONAME current and age args to reflect this is a minor library
version update.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17911
DeltaFile
+1-1lib/libnvpair/Makefile.am
+1-11 files

OpenZFS/src 7ebb5e9lib/libzfs/os/linux libzfs_util_os.c

Reduce timeout to zero when running inside a container

Detect container environments and set timeout to zero unless
ZFS_MODULE_TIMEOUT is already set. This avoids an unnecessary ten
second delay after running zfs/zpool commands in a container where
/dev/zfs is unavailable.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Adi Gollamudi <adigollamudi at gmail.com>
Closes #15165
Closes #17922
DeltaFile
+37-0lib/libzfs/os/linux/libzfs_util_os.c
+37-01 files

OpenZFS/src 1e8c96dlib/libzfs libzfs.abi, man/man7 vdevprops.7

Add knob to disable slow io notifications

Introduce a new vdev property `VDEV_PROP_SLOW_IO_REPORTING` that
allows users to disable notifications for slow devices.
This prevents ZED and/or ZFSD from degrading the pool due to slow
I/O.

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: Mariusz Zaborski <oshogbo at FreeBSD.org>
Closes 17477
DeltaFile
+61-25module/zfs/vdev.c
+42-2tests/zfs-tests/tests/functional/events/zed_slow_io.ksh
+6-3module/zfs/zio.c
+7-1man/man7/vdevprops.7
+2-1lib/libzfs/libzfs.abi
+3-0module/zcommon/zpool_prop.c
+121-324 files not shown
+127-3210 files

OpenZFS/src 41878d5cmd/zpool zpool_main.c, man/man8 zpool-prefetch.8

Add BRT support to zpool prefetch command

Implement BRT (Block Reference Table) prefetch functionality similar
to existing DDT prefetch.  This allows preloading BRT metadata into
ARC to improve performance for block cloning operations and frees
of earlier cloned blocks.

Make -t parameter optional.  When omitted, prefetch all supported
metadata types (both DDT and BRT now).

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17890
DeltaFile
+95-0tests/zfs-tests/tests/functional/cli_root/zpool_prefetch/zpool_prefetch_002_pos.ksh
+20-14cmd/zpool/zpool_main.c
+17-10module/zfs/zfs_ioctl.c
+16-11man/man8/zpool-prefetch.8
+25-0module/zfs/brt.c
+10-2tests/zfs-tests/tests/functional/cli_root/zpool_prefetch/zpool_prefetch_001_pos.ksh
+183-376 files not shown
+198-4212 files

OpenZFS/src 002bc3dman/man4 zfs.4, module/zfs brt.c

BRT: Increase block size from 4KB to 8KB

According to my observations, BRT ZAPs are typically compressible
3:1 for data and 2:1 for indirects.  With ashift=12, typical these
days, it means increasing the block sizes to 8KB we may get most
of possible compression, reducing on-disk and in-ARC BRT footprint
in half by the cost of some compression/decompression overhead,
but without real write inflation, only some dirty data increase.

Increase to 32KB similar to DDT could further increase compression
and storage efficiency, but at the cost of write inflation and
much bigger dirty data increase, which we can not properly control
now.  So lets leave this for a time when BRT log gets implemented.

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

OpenZFS/src e895c76module/zfs zap_micro.c

ZAP: Remove dmu_object_info_from_dnode() call

dmu_object_info_from_dnode() takes two locks and copies plenty of
data that we don't need in zap_lockdir_impl().  Just read dn_type
directly in this hot path.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17921 
DeltaFile
+1-3module/zfs/zap_micro.c
+1-31 files

OpenZFS/src ac0bc4ccmd ztest.c, include/sys spa.h

spa_misc: add an API for spa_namespace_lock

This is useful as debugging support, as it lets namespace lock
operations be traced directly. It will also be useful for future work to
reduce the use of spa_namespace_lock, traditionally a source of
difficult deadlocks.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17906 
DeltaFile
+87-87module/zfs/spa.c
+81-29module/zfs/spa_misc.c
+12-12cmd/ztest.c
+10-10module/zfs/vdev_removal.c
+7-7module/zfs/zfs_ioctl.c
+9-5include/sys/spa.h
+206-15015 files not shown
+260-20421 files

OpenZFS/src e305c7dinclude/sys brt_impl.h

BRT: Fix ranges to blocks conversion math

BRT_RANGESIZE_TO_NBLOCKS() takes number of ranges as its argument.
To get number of blocks we should multiply it by the entry size,
not divide by it, as it was due to missing parentheses.

Before #17875 this could cause small memory corruptions for vdevs
bigger than 64TB, but the change made the bug more noticeable.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17886
Closes #17915
DeltaFile
+1-1include/sys/brt_impl.h
+1-11 files

OpenZFS/src e173411man/man7 zpoolconcepts.7

Update man page description of zpool rewind

Update description of zpool import --rewind-to-checkpoint in
man/man7/zpoolconcepts.7 to explain that rewinding automatically
discards a checkpoint.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Adi Gollamudi <adigollamudi at gmail.com>
Closes #12646
Closes #17918
DeltaFile
+5-0man/man7/zpoolconcepts.7
+5-01 files

OpenZFS/src aaf374binclude/os/freebsd/spl/sys mod.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.h
+127-183 files

OpenZFS/src 583db40module/os/freebsd/zfs zfs_vnops_os.c

FreeBSD: Add support for _PC_CASE_INSENSITIVE

FreeBSD now has a pathconf name called _PC_CASE_INSENSITIVE
used to check if a file system performs case insensitive
name lookups.

This patch adds support for this name.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
 Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rick Macklem <rmacklem at uoguelph.ca>
Closes #17908
DeltaFile
+10-1module/os/freebsd/zfs/zfs_vnops_os.c
+10-11 files

OpenZFS/src 84dd555module Makefile.bsd Kbuild.in, module/zstd/include aarch64_compat.h

zstd: disable intrinsics

Disable the aarch64 NEON SIMD intrinsics for kernel builds.  Safely
using them in the kernel context requires saving/restoring the FPU
registers which is not currently done.

Additionally, remove the aarch64 optimized PREFETCH_L1 and PREFETCH_L2
instruction.  Rely on the more portable compiler built ins.

This lets us remove the problematic workaround in the aarch64_compat.h
header which undefines the __aarch64__ macro.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17904
Closes #17852
DeltaFile
+0-38module/zstd/include/aarch64_compat.h
+0-24module/Makefile.bsd
+9-0module/zstd/lib/common/zstd_internal.h
+0-3module/zstd/lib/common/compiler.h
+1-2module/Kbuild.in
+10-675 files

OpenZFS/src 015729amodule/zfs vdev_raidz.c

Fix typo in vdev_raidz.c

Change the spelling of "begining" on line 4875 to
"beginning".

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Adi Gollamudi <adigollamudi at gmail.com>
Closes #17905
DeltaFile
+1-1module/zfs/vdev_raidz.c
+1-11 files

OpenZFS/src 4fd926alib/libzfs libzfs_sendrecv.c

libzfs: ignoring unreachable code

We have infinite loop and on certain condition, we exit this loop
and thread with pthread_exit(). But also after this loop,
we have a code to perform pthread_cleanup_pop() and return from the
thread.

The  problem is that modern compilers are able to recognize that we
actually never get to the statements after loop and therefore
it is dead code there.

I think, instead of pthread_exit(), it is better to break out of loop
and let the last statements to work as intended. This is because
we do need to keep pthread_cleanup_pop() anyhow. Of course,
it is matter of taste if we want to use return or pthread_exit as very
last statement in this function.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>

    [2 lines not shown]
DeltaFile
+3-2lib/libzfs/libzfs_sendrecv.c
+3-21 files

OpenZFS/src 7b12138man/man8 zfs-rewrite.8

man: describe zfs-rewrite method and properties

We've heard anecdotes that suggest some
confusion/surprise/disappointment that a changed recordsize is not
applied during rewrite. Until such time as we actually can do that, we
can at least explicitly mention it at something that doesn't work.

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>
Reviewed-by: Allan Jude <allan at klarasystems.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17898
DeltaFile
+19-3man/man8/zfs-rewrite.8
+19-31 files

OpenZFS/src 055e908man/man8 zfs-jail.8

zfs-jail.8: Add introductory sentence, refactor

Add an introductory sentance explaining why the reader may want to use
this command, and establishing the requirement that the jail must be
running. Move other requirements from the description of the subcommands
to follow this for flow and structure. Move the caveat that this is for
FreeBSD down to a cannonical CAVEATS section, and crossreference Linux's
equivelant functionality. Mention that this utility can not be used to
delegate the root directory of the jail to that section also.

Reported by: Jan Brankamp <crest at rlwinm.de>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Allan Jude <allan at klarasystems.com>
Signed-off-by: Alexander Ziaee <ziaee at FreeBSD.org>
Closes #17883
DeltaFile
+49-30man/man8/zfs-jail.8
+49-301 files

OpenZFS/src a2a34d9cmd/zfs zfs_project.c, include/sys zfs_project.h

Linux 6.17 compat: Fix broken projectquota on 6.17

We need to specifically use the FX_XFLAG_* macros in zpl_ioctl_*attr()
codepaths, and the FS_*_FL macros in the zpl_ioctl_*flags() codepaths.
The earlier code just assumes the FS_*_FL macros for both codepaths.
The 6.17 kernel add a bitmask check in copy_fsxattr_from_user() that
exposed this error via failing 'projectquota' ZTS tests.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #17884
Closes #17869
DeltaFile
+77-16module/os/linux/zfs/zpl_file.c
+28-8cmd/zfs/zfs_project.c
+33-0lib/libspl/include/os/linux/sys/vfs.h
+4-6include/sys/zfs_project.h
+3-3module/os/freebsd/zfs/zfs_vnops_os.c
+1-0lib/libspl/include/Makefile.am
+146-336 files

OpenZFS/src dda711dmodule/zfs zio.c

Fix gang write late_arrival bug

When a write comes in via dmu_sync_late_arrival, its txg is equal to the
open TXG. If that write gangs, and we have not yet activated the new
gang header feature, and the gang header we pick can store a larger gang
header, we will try to schedule the upgrade for the open TXG + 1. In
debug mode, this causes an assertion to trip. This PR sets the TXG for
activating the feature to be the larger of either the current open TXG
or the syncing TXG + 1.

Reviewed-by: Alexander Motin <mav at FreeBSD.org>
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 #17824
DeltaFile
+2-2module/zfs/zio.c
+2-21 files