The branch releng/14.1 has been updated by mm:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=78c9d8f1ce655f10368c06272f5e320b8a263612

commit 78c9d8f1ce655f10368c06272f5e320b8a263612
Author:     Martin Matuska <[email protected]>
AuthorDate: 2024-05-03 21:51:01 +0000
Commit:     Martin Matuska <[email protected]>
CommitDate: 2024-05-08 15:24:29 +0000

    zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/14
    
    OpenZFS release 2.2.4
    
    Notable upstream pull request merges:
     #15076 fdd97e009 Refactor dmu_prefetch()
     #15225 5972bb856 Use ASSERT0P() to check that a pointer is NULL
     #15381 7ea833100 ZIL: Detect single-threaded workloads
     #15515 8b1a132de ZIO: Optimize zio_flush()
     #15225 d6da6cbd7 Clean up existing VERIFY*() macros
     #15225 5dda8c091 Add VERIFY0P() and ASSERT0P() macros
     #15436 61f3638a3 Add prefetch property
     #15509 6f323353d Add ashift validation when adding devices to a pool
     #15539 ea3f7c12a Extend import_progress kstat with a notes field
     #15635 25ea8ce94 ZIL: Improve next log block size prediction
     #15784 16c223eec Do no use .cfi_negate_ra_state within the assembly on
                      Arm64
     #15839 706307445 vdev probe to slow disk can stall mmp write checker
     #15879 86b39b41a zpool: Fix locale-specific time
     #15927 fa5de0c5c Update resume token at object receive
     #15941 fdd8c0aea BRT: Skip duplicate BRT prefetches
     #15942 889152ce4 Give better message from 'zpool get' with invalid pool
                      name
     #15950 3e91a9c52 BRT: Skip getting length in brt_entry_lookup()
     #15951 19bf54b76 ZAP: Massively switch to _by_dnode() interfaces
     #15954 f7c1db636 BRT: Change brt_pending_tree sorting order
     #15955 457e62d7c BRT: Relax brt_pending_apply() locking
     #15967 c94f73007 BRT: Make BRT block sizes configurable
     #15976 dced953b6 ZAP: Some cleanups/micro-optimizations
     #15983 531572b59 Fix panics when truncating/deleting files
     #15992 5fc134ff2 zvol: use multiple taskq
     #16007 2ea370a4e BRT: Fix holes cloning
     #16008 67995229a zpool: Fix option string, adding -e and fixing order
     #16015 8a5604713 Add support for zfs mount -R <filesystem>
     #16022 026fe7964 Speculative prefetch for reordered requests
     #16040 575872cc3 L2ARC: Relax locking during write
     #16042 d5fb6abd3 Improve dbuf_read() error reporting
     #16051 5d859a2e2 xdr: header cleanup
     #16052 602b5dca7 Fix read errors race after block cloning
     #16057 97d7228f4 Remove db_state DB_NOFILL checks from syncing context
     #16072 f4ce02ae4 Small fix to prefetch ranges aggregation
     #16074 97889c037 return NULL at end of send_progress_thread
     #16086 7aaf6ce9d Add the BTI elf note to the AArch64 SHA2 assembly
     #16094 4d17e200d Add zfetch stats in arcstats
     #16128 3d4d61988 Fix updating the zvol_htable when renaming a zvol
     #16141 b3b37b84e Fix arcstats for FreeBSD after zfetch support
    
    Obtained from:  OpenZFS
    OpenZFS commit: 2566592045780e7be7afc899c2496b1ae3af4f4d
    OpenZFS tag:    zfs-2.2.4
    Approved by:    re (cperciva)
    
    (cherry picked from commit 9a5f0cb5b639f8e0435103d44b17eb8a352af990)
---
 cddl/lib/libnvpair/Makefile                        |   2 -
 sys/contrib/openzfs/.mailmap                       |  18 +
 sys/contrib/openzfs/AUTHORS                        |  35 +
 sys/contrib/openzfs/META                           |   4 +-
 sys/contrib/openzfs/cmd/arc_summary                |  11 +-
 sys/contrib/openzfs/cmd/arcstat.in                 |  57 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_api.c       |  57 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_api.h       |   3 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c      |   3 +-
 sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h      |   2 +-
 sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 143 +++-
 sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c    |   3 +
 sys/contrib/openzfs/cmd/zfs/zfs_main.c             |  75 +-
 sys/contrib/openzfs/cmd/zinject/zinject.c          |  16 +
 .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c     |   4 +-
 sys/contrib/openzfs/cmd/zpool/zpool_main.c         | 146 ++--
 sys/contrib/openzfs/cmd/ztest.c                    |   8 +-
 sys/contrib/openzfs/config/Substfiles.am           |   3 +-
 sys/contrib/openzfs/config/always-pyzfs.m4         |   9 +-
 sys/contrib/openzfs/config/ax_python_devel.m4      | 341 +++++---
 sys/contrib/openzfs/config/kernel-blk-queue.m4     |  15 +
 sys/contrib/openzfs/config/kernel-blkdev.m4        | 159 +++-
 sys/contrib/openzfs/config/kernel-filemap.m4       |   1 +
 .../openzfs/config/kernel-make-request-fn.m4       |  33 +
 sys/contrib/openzfs/config/kernel-mm-page-size.m4  |  17 +
 .../openzfs/config/kernel-vfs-file_range.m4        |  27 +
 sys/contrib/openzfs/config/kernel.m4               |   4 +
 sys/contrib/openzfs/config/zfs-build.m4            |   8 +-
 sys/contrib/openzfs/contrib/debian/control         |   2 +-
 sys/contrib/openzfs/etc/init.d/README.md           |   6 +-
 sys/contrib/openzfs/etc/init.d/zfs-import.in       |   2 +-
 sys/contrib/openzfs/etc/init.d/zfs-load-key.in     |   2 +-
 sys/contrib/openzfs/etc/init.d/zfs-mount.in        |   2 +-
 sys/contrib/openzfs/etc/init.d/zfs-share.in        |   3 +-
 sys/contrib/openzfs/etc/init.d/zfs-zed.in          |   3 +-
 sys/contrib/openzfs/include/libzfs.h               |   6 +-
 sys/contrib/openzfs/include/os/freebsd/Makefile.am |   4 +-
 .../openzfs/include/os/freebsd/spl/rpc/xdr.h       |  71 --
 .../openzfs/include/os/freebsd/spl/sys/debug.h     |  40 +-
 sys/contrib/openzfs/include/os/linux/Makefile.am   |   2 +
 .../include/os/linux/kernel/linux/blkdev_compat.h  |   6 +-
 .../include/os/linux/kernel/linux/mm_compat.h      |  36 +
 .../include/os/linux/kernel/linux/mod_compat.h     |   1 +
 .../openzfs/include/os/linux/spl/rpc/types.h       |  30 +
 sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h |   2 -
 .../openzfs/include/os/linux/spl/sys/debug.h       |  38 +-
 .../openzfs/include/os/linux/spl/sys/taskq.h       |   2 +-
 .../openzfs/include/os/linux/zfs/sys/trace_zil.h   |  14 +-
 sys/contrib/openzfs/include/sys/abd.h              |   9 +
 sys/contrib/openzfs/include/sys/abd_impl.h         |  26 +-
 sys/contrib/openzfs/include/sys/dmu.h              |   5 +-
 sys/contrib/openzfs/include/sys/dmu_objset.h       |   1 +
 sys/contrib/openzfs/include/sys/dmu_zfetch.h       |  16 +-
 sys/contrib/openzfs/include/sys/fm/fs/zfs.h        |   2 +
 sys/contrib/openzfs/include/sys/fs/zfs.h           |  14 +-
 sys/contrib/openzfs/include/sys/multilist.h        |   5 +-
 sys/contrib/openzfs/include/sys/spa.h              |  12 +-
 sys/contrib/openzfs/include/sys/uberblock_impl.h   |  16 +-
 sys/contrib/openzfs/include/sys/vdev_impl.h        |   7 +-
 sys/contrib/openzfs/include/sys/zap.h              |   8 +
 sys/contrib/openzfs/include/sys/zap_impl.h         |   1 +
 sys/contrib/openzfs/include/sys/zap_leaf.h         |  10 +-
 sys/contrib/openzfs/include/sys/zil_impl.h         |  10 +-
 sys/contrib/openzfs/lib/libspl/include/assert.h    |  15 +-
 sys/contrib/openzfs/lib/libuutil/uu_list.c         |  14 +-
 sys/contrib/openzfs/lib/libzfs/libzfs.abi          |  84 +-
 sys/contrib/openzfs/lib/libzfs/libzfs_pool.c       |  13 +-
 sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c   |   1 +
 sys/contrib/openzfs/lib/libzfs/libzfs_util.c       |  12 +-
 .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c   |  10 +
 sys/contrib/openzfs/man/Makefile.am                |   4 +-
 sys/contrib/openzfs/man/man4/spl.4                 |  18 +-
 sys/contrib/openzfs/man/man4/zfs.4                 |  83 +-
 sys/contrib/openzfs/man/man7/vdevprops.7           |  12 +-
 sys/contrib/openzfs/man/man7/zfsprops.7            |  17 +
 sys/contrib/openzfs/man/man7/zpoolconcepts.7       |   4 +-
 sys/contrib/openzfs/man/man8/zfs-mount.8           |   6 +-
 sys/contrib/openzfs/man/man8/zinject.8             |   1 +
 sys/contrib/openzfs/man/man8/zpool-add.8           |  18 +-
 sys/contrib/openzfs/man/man8/zpool-clear.8         |   7 +-
 sys/contrib/openzfs/man/man8/zpool-status.8        |  18 +-
 .../icp/asm-aarch64/blake3/b3_aarch64_sse2.S       |  14 +-
 .../icp/asm-aarch64/blake3/b3_aarch64_sse41.S      |  12 +-
 .../module/icp/asm-aarch64/sha2/sha256-armv8.S     |  10 +
 .../module/icp/asm-aarch64/sha2/sha512-armv8.S     |  10 +
 sys/contrib/openzfs/module/nvpair/nvpair.c         |   1 +
 sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c |   4 +-
 .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c   |   4 +-
 .../openzfs/module/os/freebsd/zfs/zvol_os.c        |   2 +-
 .../openzfs/module/os/linux/spl/spl-taskq.c        |  85 +-
 sys/contrib/openzfs/module/os/linux/spl/spl-xdr.c  |   1 +
 sys/contrib/openzfs/module/os/linux/zfs/abd_os.c   | 123 ++-
 .../openzfs/module/os/linux/zfs/vdev_disk.c        | 913 ++++++++++++++++-----
 .../openzfs/module/os/linux/zfs/zfs_vnops_os.c     |  12 +-
 sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c |   8 +-
 .../openzfs/module/os/linux/zfs/zpl_file_range.c   |  16 +-
 sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c  | 140 +++-
 sys/contrib/openzfs/module/zcommon/zfs_prop.c      |  11 +
 sys/contrib/openzfs/module/zcommon/zpool_prop.c    |   6 +
 sys/contrib/openzfs/module/zfs/abd.c               |  42 +
 sys/contrib/openzfs/module/zfs/arc.c               | 179 ++--
 sys/contrib/openzfs/module/zfs/brt.c               | 147 +---
 sys/contrib/openzfs/module/zfs/dbuf.c              | 160 ++--
 sys/contrib/openzfs/module/zfs/dmu.c               | 149 ++--
 sys/contrib/openzfs/module/zfs/dmu_objset.c        |  29 +-
 sys/contrib/openzfs/module/zfs/dmu_recv.c          |  17 +-
 sys/contrib/openzfs/module/zfs/dmu_zfetch.c        | 296 +++++--
 sys/contrib/openzfs/module/zfs/dsl_deadlist.c      |   8 +-
 sys/contrib/openzfs/module/zfs/metaslab.c          |   8 +-
 sys/contrib/openzfs/module/zfs/mmp.c               |   5 +-
 sys/contrib/openzfs/module/zfs/multilist.c         |  26 +-
 sys/contrib/openzfs/module/zfs/spa.c               | 149 +++-
 sys/contrib/openzfs/module/zfs/spa_log_spacemap.c  |  16 +-
 sys/contrib/openzfs/module/zfs/spa_misc.c          |  74 +-
 sys/contrib/openzfs/module/zfs/txg.c               |   9 +
 sys/contrib/openzfs/module/zfs/vdev.c              |  52 +-
 sys/contrib/openzfs/module/zfs/vdev_label.c        |   4 +-
 sys/contrib/openzfs/module/zfs/vdev_raidz.c        |   5 +-
 sys/contrib/openzfs/module/zfs/zap.c               |  43 +-
 sys/contrib/openzfs/module/zfs/zap_leaf.c          |  77 +-
 sys/contrib/openzfs/module/zfs/zap_micro.c         | 206 +++--
 sys/contrib/openzfs/module/zfs/zfs_fm.c            |  26 +
 sys/contrib/openzfs/module/zfs/zfs_ioctl.c         |  13 +-
 sys/contrib/openzfs/module/zfs/zfs_vnops.c         |   6 +-
 sys/contrib/openzfs/module/zfs/zil.c               | 352 +++++---
 sys/contrib/openzfs/module/zfs/zio.c               |  42 +-
 sys/contrib/openzfs/module/zfs/zio_inject.c        |   6 +
 sys/contrib/openzfs/module/zfs/zvol.c              |   2 +-
 sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in    |   2 +-
 sys/contrib/openzfs/tests/runfiles/common.run      |   8 +-
 sys/contrib/openzfs/tests/runfiles/linux.run       |   5 +-
 sys/contrib/openzfs/tests/runfiles/sanity.run      |   3 +-
 .../openzfs/tests/zfs-tests/tests/Makefile.am      |   5 +
 .../tests/functional/bclone/bclone_common.kshlib   |  47 +-
 .../functional/bclone/bclone_corner_cases.kshlib   |  20 +-
 .../functional/cli_root/zfs_mount/zfs_mount.cfg    |   1 +
 .../cli_root/zfs_mount/zfs_mount_recursive.ksh     | 146 ++++
 .../functional/cli_root/zpool_add/add-o_ashift.ksh |  17 +-
 .../cli_root/zpool_add/add_prop_ashift.ksh         |  16 +-
 .../zpool_add/zpool_add--allow-ashift-mismatch.ksh |   0
 .../cli_root/zpool_add/zpool_add_002_pos.ksh       |  11 +
 .../cli_root/zpool_add/zpool_add_004_pos.ksh       |   2 +-
 .../cli_root/zpool_add/zpool_add_005_pos.ksh       |   2 +
 .../cli_root/zpool_add/zpool_add_009_neg.ksh       |   2 +
 .../cli_root/zpool_add/zpool_add_010_pos.ksh       |   2 +-
 .../functional/cli_root/zpool_get/vdev_get.cfg     |   2 +
 .../cli_root/zpool_import/zpool_import_status.ksh  | 132 +++
 .../tests/functional/cp_files/cp_files_002_pos.ksh |   6 +-
 .../zfs-tests/tests/functional/events/cleanup.ksh  |   4 +-
 .../tests/functional/events/zed_slow_io.ksh        | 205 +++++
 .../functional/events/zed_slow_io_many_vdevs.ksh   | 177 ++++
 .../zfs-tests/tests/functional/fault/cleanup.ksh   |   1 +
 .../zfs-tests/tests/functional/fault/setup.ksh     |   1 +
 .../tests/functional/mmp/mmp_write_slow_disk.ksh   |  97 +++
 .../user_namespace/user_namespace_004.ksh          |   4 +-
 sys/contrib/openzfs/udev/zvol_id.c                 |   9 +-
 sys/modules/zfs/zfs_config.h                       |  50 +-
 sys/modules/zfs/zfs_gitrev.h                       |   2 +-
 158 files changed, 4808 insertions(+), 1646 deletions(-)

diff --git a/cddl/lib/libnvpair/Makefile b/cddl/lib/libnvpair/Makefile
index fb80d7c22ea5..a93ffcbd00de 100644
--- a/cddl/lib/libnvpair/Makefile
+++ b/cddl/lib/libnvpair/Makefile
@@ -27,6 +27,4 @@ CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
 CFLAGS+= -include 
${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
 CFLAGS+= -DHAVE_ISSETUGID  -DHAVE_CONFIG_H -DHAVE_XDR_BYTESREC
 
-
-CFLAGS.nvpair.c+= -UHAVE_RPC_TYPES
 .include <bsd.lib.mk>
diff --git a/sys/contrib/openzfs/.mailmap b/sys/contrib/openzfs/.mailmap
index 46ef016b93f8..32bdb5209613 100644
--- a/sys/contrib/openzfs/.mailmap
+++ b/sys/contrib/openzfs/.mailmap
@@ -30,6 +30,7 @@ Andreas Dilger <[email protected]>
 Andrew Walker <[email protected]>
 Benedikt Neuffer <[email protected]>
 Chengfei Zhu <[email protected]>
+ChenHao Lu <[email protected]>
 Chris Lindee <[email protected]>
 Colm Buckley <[email protected]>
 Crag Wang <[email protected]>
@@ -43,6 +44,7 @@ Glenn Washburn <[email protected]>
 Gordan Bobic <[email protected]>
 Gregory Bartholomew <[email protected]>
 hedong zhang <[email protected]>
+Ilkka Sovanto <[email protected]>
 InsanePrawn <[email protected]>
 Jason Cohen <[email protected]>
 Jason Harmening <[email protected]>
@@ -57,6 +59,7 @@ KernelOfTruth <[email protected]>
 Liu Hua <[email protected]>
 Liu Qing <[email protected]>
 loli10K <[email protected]>
+Mart Frauenlob <[email protected]>
 Matthias Blankertz <[email protected]>
 Michael Gmelin <[email protected]>
 Olivier Mazouffre <[email protected]>
@@ -73,6 +76,9 @@ WHR <[email protected]>
 Yanping Gao <[email protected]>
 Youzhong Yang <[email protected]>
 
+# Signed-off-by: overriding Author:
+Yuxin Wang <[email protected]> <[email protected]>
+
 # Commits from strange places, long ago
 Brian Behlendorf <[email protected]> 
<behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
 Brian Behlendorf <[email protected]> <behlendo@fedora-17-amd64.(none)>
@@ -102,12 +108,15 @@ Brandon Thetford <[email protected]> 
<[email protected]>
 buzzingwires <[email protected]> 
<[email protected]>
 Cedric Maunoury <[email protected]> 
<[email protected]>
 Charles Suh <[email protected]> <[email protected]>
+Chris Peredun <[email protected]> 
<[email protected]>
 Dacian Reece-Stremtan <[email protected]> 
<[email protected]>
 Damian Szuberski <[email protected]> 
<[email protected]>
 Daniel Hiepler <[email protected]> <[email protected]>
 Daniel Kobras <[email protected]> 
<[email protected]>
 Daniel Reichelt <[email protected]> <[email protected]>
 David Quigley <[email protected]> <[email protected]>
+Dennis R. Friedrichsen <[email protected]> 
<[email protected]>
+Dex Wood <[email protected]> <[email protected]>
 DHE <[email protected]> <[email protected]>
 Dmitri John Ledkov <[email protected]> 
<[email protected]>
 Dries Michiels <[email protected]> 
<[email protected]>
@@ -128,6 +137,7 @@ Harry Mallon <[email protected]> 
<[email protected]>
 Hiếu Lê <[email protected]> <[email protected]>
 Jake Howard <[email protected]> <[email protected]>
 James Cowgill <[email protected]> <[email protected]>
+Jaron Kent-Dobias <[email protected]> <[email protected]>
 Jason King <[email protected]> <[email protected]>
 Jeff Dike <[email protected]> <[email protected]>
 Jitendra Patidar <[email protected]> 
<[email protected]>
@@ -137,7 +147,9 @@ John L. Hammond <[email protected]> 
<[email protected].
 John-Mark Gurney <[email protected]> <[email protected]>
 John Ramsden <[email protected]> <[email protected]>
 Jonathon Fernyhough <[email protected]> 
<[email protected]>
+Jose Luis Duran <[email protected]> <[email protected]>
 Justin Hibbits <[email protected]> <[email protected]>
+Kevin Greene <[email protected]> 
<[email protected]>
 Kevin Jin <[email protected]> 
<[email protected]>
 Kevin P. Fleming <[email protected]> <[email protected]>
 Krzysztof Piecuch <[email protected]> 
<[email protected]>
@@ -148,9 +160,11 @@ Lorenz Hüdepohl <[email protected]> 
<[email protected]>
 Luís Henriques <[email protected]> 
<[email protected]>
 Marcin Skarbek <[email protected]> <[email protected]>
 Matt Fiddaman <[email protected]> 
<[email protected]>
+Maxim Filimonov <[email protected]> <[email protected]>
 Max Zettlmeißl <[email protected]> <[email protected]>
 Michael Niewöhner <[email protected]> <[email protected]>
 Michael Zhivich <[email protected]> 
<[email protected]>
+MigeljanImeri <[email protected]> 
<[email protected]>
 Mo Zhou <[email protected]> <[email protected]>
 Nick Mattis <[email protected]> <[email protected]>
 omni <[email protected]> <[email protected]>
@@ -164,6 +178,7 @@ Ping Huang <[email protected]> 
<[email protected]>
 Piotr P. Stefaniak <[email protected]> <[email protected]>
 Richard Allen <[email protected]> 
<[email protected]>
 Rich Ercolani <[email protected]> 
<[email protected]>
+Rick Macklem <[email protected]> 
<[email protected]>
 Rob Wing <[email protected]> 
<[email protected]>
 Roman Strashkin <[email protected]> <[email protected]>
 Ryan Hirasaki <[email protected]> 
<[email protected]>
@@ -174,6 +189,8 @@ Scott Colby <[email protected]> 
<[email protected]>
 Sean Eric Fagan <[email protected]> <[email protected]>
 Spencer Kinny <[email protected]> 
<[email protected]>
 Srikanth N S <[email protected]> 
<[email protected]>
+Stefan Lendl <[email protected]> <[email protected]>
+Thomas Bertschinger <[email protected]> 
<[email protected]>
 Thomas Geppert <[email protected]> <[email protected]>
 Tim Crawford <[email protected]> <[email protected]>
 Tom Matthews <[email protected]> <[email protected]>
@@ -181,6 +198,7 @@ Tony Perkins <[email protected]> 
<[email protected]>
 Torsten Wörtwein <[email protected]> <[email protected]>
 Tulsi Jain <[email protected]> <[email protected]>
 Václav Skála <[email protected]> 
<[email protected]>
+Vaibhav Bhanawat <[email protected]> 
<[email protected]>
 Violet Purcell <[email protected]> 
<[email protected]>
 Vipin Kumar Verma <[email protected]> 
<[email protected]>
 Wolfgang Bumiller <[email protected]> <[email protected]>
diff --git a/sys/contrib/openzfs/AUTHORS b/sys/contrib/openzfs/AUTHORS
index be1efb87b34c..d7d55f42d2e7 100644
--- a/sys/contrib/openzfs/AUTHORS
+++ b/sys/contrib/openzfs/AUTHORS
@@ -88,9 +88,11 @@ CONTRIBUTORS:
     Bassu <[email protected]>
     Ben Allen <[email protected]>
     Ben Cordero <[email protected]>
+    Benda Xu <[email protected]>
     Benedikt Neuffer <[email protected]>
     Benjamin Albrecht <[email protected]>
     Benjamin Gentil <[email protected]>
+    Benjamin Sherman <[email protected]>
     Ben McGough <[email protected]>
     Ben Rubson <[email protected]>
     Ben Wolsieffer <[email protected]>
@@ -111,6 +113,7 @@ CONTRIBUTORS:
     bzzz77 <[email protected]>
     cable2999 <[email protected]>
     Caleb James DeLisle <[email protected]>
+    Cameron Harr <[email protected]>
     Cao Xuewen <[email protected]>
     Carlo Landmeter <[email protected]>
     Carlos Alberto Lopez Perez <[email protected]>
@@ -120,12 +123,15 @@ CONTRIBUTORS:
     Chen Can <[email protected]>
     Chengfei Zhu <[email protected]>
     Chen Haiquan <[email protected]>
+    ChenHao Lu <[email protected]>
     Chip Parker <[email protected]>
     Chris Burroughs <[email protected]>
+    Chris Davidson <[email protected]>
     Chris Dunlap <[email protected]>
     Chris Dunlop <[email protected]>
     Chris Lindee <[email protected]>
     Chris McDonough <[email protected]>
+    Chris Peredun <[email protected]>
     Chris Siden <[email protected]>
     Chris Siebenmann <[email protected]>
     Christer Ekholm <[email protected]>
@@ -144,6 +150,7 @@ CONTRIBUTORS:
     Clint Armstrong <[email protected]>
     Coleman Kane <[email protected]>
     Colin Ian King <[email protected]>
+    Colin Percival <[email protected]>
     Colm Buckley <[email protected]>
     Crag Wang <[email protected]>
     Craig Loomis <[email protected]>
@@ -156,6 +163,7 @@ CONTRIBUTORS:
     Damiano Albani <[email protected]>
     Damian Szuberski <[email protected]>
     Damian Wojsław <[email protected]>
+    Daniel Berlin <[email protected]>
     Daniel Hiepler <[email protected]>
     Daniel Hoffman <[email protected]>
     Daniel Kobras <[email protected]>
@@ -176,8 +184,10 @@ CONTRIBUTORS:
     David Quigley <[email protected]>
     Debabrata Banerjee <[email protected]>
     D. Ebdrup <[email protected]>
+    Dennis R. Friedrichsen <[email protected]>
     Denys Rtveliashvili <[email protected]>
     Derek Dai <[email protected]>
+    Dex Wood <[email protected]>
     DHE <[email protected]>
     Didier Roche <[email protected]>
     Dimitri John Ledkov <[email protected]>
@@ -235,9 +245,11 @@ CONTRIBUTORS:
     Gionatan Danti <[email protected]>
     Giuseppe Di Natale <[email protected]>
     Glenn Washburn <[email protected]>
+    gofaster <[email protected]>
     Gordan Bobic <[email protected]>
     Gordon Bergling <[email protected]>
     Gordon Ross <[email protected]>
+    Gordon Tetlow <[email protected]>
     Graham Christensen <[email protected]>
     Graham Perrin <[email protected]>
     Gregor Kopka <[email protected]>
@@ -265,6 +277,7 @@ CONTRIBUTORS:
     Igor Kozhukhov <[email protected]>
     Igor Lvovsky <[email protected]>
     ilbsmart <[email protected]>
+    Ilkka Sovanto <[email protected]>
     illiliti <[email protected]>
     ilovezfs <[email protected]>
     InsanePrawn <[email protected]>
@@ -280,9 +293,11 @@ CONTRIBUTORS:
     Jan Engelhardt <[email protected]>
     Jan Kryl <[email protected]>
     Jan Sanislo <[email protected]>
+    Jaron Kent-Dobias <[email protected]>
     Jason Cohen <[email protected]>
     Jason Harmening <[email protected]>
     Jason King <[email protected]>
+    Jason Lee <[email protected]>
     Jason Zaman <[email protected]>
     Javen Wu <[email protected]>
     Jean-Baptiste Lallement <[email protected]>
@@ -313,6 +328,7 @@ CONTRIBUTORS:
     Jonathon Fernyhough <[email protected]>
     Jorgen Lundman <[email protected]>
     Josef 'Jeff' Sipek <[email protected]>
+    Jose Luis Duran <[email protected]>
     Josh Soref <[email protected]>
     Joshua M. Clulow <[email protected]>
     José Luis Salvador Rufo <[email protected]>
@@ -336,8 +352,10 @@ CONTRIBUTORS:
     Kash Pande <[email protected]>
     Kay Pedersen <[email protected]>
     Keith M Wesolowski <[email protected]>
+    Kent Ross <[email protected]>
     KernelOfTruth <[email protected]>
     Kevin Bowling <[email protected]>
+    Kevin Greene <[email protected]>
     Kevin Jin <[email protected]>
     Kevin P. Fleming <[email protected]>
     Kevin Tanguy <[email protected]>
@@ -389,6 +407,7 @@ CONTRIBUTORS:
     Mark Shellenbaum <[email protected]>
     marku89 <[email protected]>
     Mark Wright <[email protected]>
+    Mart Frauenlob <[email protected]>
     Martin Matuska <[email protected]>
     Martin Rüegg <[email protected]>
     Massimo Maggi <[email protected]>
@@ -405,6 +424,7 @@ CONTRIBUTORS:
     Matus Kral <[email protected]>
     Mauricio Faria de Oliveira <[email protected]>
     Max Grossman <[email protected]>
+    Maxim Filimonov <[email protected]>
     Maximilian Mehnert <[email protected]>
     Max Zettlmeißl <[email protected]>
     Md Islam <[email protected]>
@@ -417,6 +437,7 @@ CONTRIBUTORS:
     Michael Niewöhner <[email protected]>
     Michael Zhivich <[email protected]>
     Michal Vasilek <[email protected]>
+    MigeljanImeri <[email protected]>
     Mike Gerdts <[email protected]>
     Mike Harsch <[email protected]>
     Mike Leddy <[email protected]>
@@ -448,6 +469,7 @@ CONTRIBUTORS:
     Olaf Faaland <[email protected]>
     Oleg Drokin <[email protected]>
     Oleg Stepura <[email protected]>
+    Olivier Certner <[email protected]>
     Olivier Mazouffre <[email protected]>
     omni <[email protected]>
     Orivej Desh <[email protected]>
@@ -479,6 +501,7 @@ CONTRIBUTORS:
     Prasad Joshi <[email protected]>
     privb0x23 <[email protected]>
     P.SCH <[email protected]>
+    Quartz <[email protected]>
     Quentin Zdanis <[email protected]>
     Rafael Kitover <[email protected]>
     RageLtMan <[email protected]>
@@ -491,11 +514,15 @@ CONTRIBUTORS:
     Riccardo Schirone <[email protected]>
     Richard Allen <[email protected]>
     Richard Elling <[email protected]>
+    Richard Kojedzinszky <[email protected]>
     Richard Laager <[email protected]>
     Richard Lowe <[email protected]>
     Richard Sharpe <[email protected]>
     Richard Yao <[email protected]>
     Rich Ercolani <[email protected]>
+    Rick Macklem <[email protected]>
+    rilysh <[email protected]>
+    Robert Evans <[email protected]>
     Robert Novak <[email protected]>
     Roberto Ricci <[email protected]>
     Rob Norris <[email protected]>
@@ -509,7 +536,9 @@ CONTRIBUTORS:
     Ryan Lahfa <[email protected]>
     Ryan Libby <[email protected]>
     Ryan Moeller <[email protected]>
+    Sam Atkinson <[email protected]>
     Sam Hathaway <[email protected]>
+    Sam James <[email protected]>
     Sam Lunt <[email protected]>
     Samuel VERSCHELDE <[email protected]>
     Samuel Wycliffe <[email protected]>
@@ -530,6 +559,8 @@ CONTRIBUTORS:
     Shaan Nobee <[email protected]>
     Shampavman <[email protected]>
     Shaun Tancheff <[email protected]>
+    Shawn Bayern <[email protected]>
+    Shengqi Chen <[email protected]>
     Shen Yan <[email protected]>
     Simon Guest <[email protected]>
     Simon Klinkert <[email protected]>
@@ -537,6 +568,7 @@ CONTRIBUTORS:
     Spencer Kinny <[email protected]>
     Srikanth N S <[email protected]>
     Stanislav Seletskiy <[email protected]>
+    Stefan Lendl <[email protected]>
     Steffen Müthing <[email protected]>
     Stephen Blinick <[email protected]>
     sterlingjensen <[email protected]>
@@ -557,6 +589,7 @@ CONTRIBUTORS:
     Teodor Spæren <[email protected]>
     TerraTech <[email protected]>
     Thijs Cramer <[email protected]>
+    Thomas Bertschinger <[email protected]>
     Thomas Geppert <[email protected]>
     Thomas Lamprecht <[email protected]>
     Till Maas <[email protected]>
@@ -586,6 +619,7 @@ CONTRIBUTORS:
     Turbo Fredriksson <[email protected]>
     Tyler J. Stachecki <[email protected]>
     Umer Saleem <[email protected]>
+    Vaibhav Bhanawat <[email protected]>
     Valmiky Arquissandas <[email protected]>
     Val Packett <[email protected]>
     Vince van Oosten <[email protected]>
@@ -614,6 +648,7 @@ CONTRIBUTORS:
     yuina822 <[email protected]>
     YunQiang Su <[email protected]>
     Yuri Pankov <[email protected]>
+    Yuxin Wang <[email protected]>
     Yuxuan Shui <[email protected]>
     Zachary Bedell <[email protected]>
     Zach Dykstra <[email protected]>
diff --git a/sys/contrib/openzfs/META b/sys/contrib/openzfs/META
index d64414e32225..383fa37fd42a 100644
--- a/sys/contrib/openzfs/META
+++ b/sys/contrib/openzfs/META
@@ -1,10 +1,10 @@
 Meta:          1
 Name:          zfs
 Branch:        1.0
-Version:       2.2.3
+Version:       2.2.4
 Release:       1
 Release-Tags:  relext
 License:       CDDL
 Author:        OpenZFS
-Linux-Maximum: 6.7
+Linux-Maximum: 6.8
 Linux-Minimum: 3.10
diff --git a/sys/contrib/openzfs/cmd/arc_summary 
b/sys/contrib/openzfs/cmd/arc_summary
index 9c69ec4f8ccc..100fb1987a8b 100755
--- a/sys/contrib/openzfs/cmd/arc_summary
+++ b/sys/contrib/openzfs/cmd/arc_summary
@@ -793,18 +793,27 @@ def section_dmu(kstats_dict):
 
     zfetch_stats = isolate_section('zfetchstats', kstats_dict)
 
-    zfetch_access_total = int(zfetch_stats['hits'])+int(zfetch_stats['misses'])
+    zfetch_access_total = int(zfetch_stats['hits']) +\
+        int(zfetch_stats['future']) + int(zfetch_stats['stride']) +\
+        int(zfetch_stats['past']) + int(zfetch_stats['misses'])
 
     prt_1('DMU predictive prefetcher calls:', f_hits(zfetch_access_total))
     prt_i2('Stream hits:',
            f_perc(zfetch_stats['hits'], zfetch_access_total),
            f_hits(zfetch_stats['hits']))
+    future = int(zfetch_stats['future']) + int(zfetch_stats['stride'])
+    prt_i2('Hits ahead of stream:', f_perc(future, zfetch_access_total),
+           f_hits(future))
+    prt_i2('Hits behind stream:',
+           f_perc(zfetch_stats['past'], zfetch_access_total),
+           f_hits(zfetch_stats['past']))
     prt_i2('Stream misses:',
            f_perc(zfetch_stats['misses'], zfetch_access_total),
            f_hits(zfetch_stats['misses']))
     prt_i2('Streams limit reached:',
            f_perc(zfetch_stats['max_streams'], zfetch_stats['misses']),
            f_hits(zfetch_stats['max_streams']))
+    prt_i1('Stream strides:', f_hits(zfetch_stats['stride']))
     prt_i1('Prefetches issued', f_hits(zfetch_stats['io_issued']))
     print()
 
diff --git a/sys/contrib/openzfs/cmd/arcstat.in 
b/sys/contrib/openzfs/cmd/arcstat.in
index 8df1c62f7e86..c4f10a1d6d3b 100755
--- a/sys/contrib/openzfs/cmd/arcstat.in
+++ b/sys/contrib/openzfs/cmd/arcstat.in
@@ -157,6 +157,16 @@ cols = {
     "free":       [5, 1024, "ARC free memory"],
     "avail":      [5, 1024, "ARC available memory"],
     "waste":      [5, 1024, "Wasted memory due to round up to pagesize"],
+    "ztotal":     [6, 1000, "zfetch total prefetcher calls per second"],
+    "zhits":      [5, 1000, "zfetch stream hits per second"],
+    "zahead":     [6, 1000, "zfetch hits ahead of streams per second"],
+    "zpast":      [5, 1000, "zfetch hits behind streams per second"],
+    "zmisses":    [7, 1000, "zfetch stream misses per second"],
+    "zmax":       [4, 1000, "zfetch limit reached per second"],
+    "zfuture":    [7, 1000, "zfetch stream future per second"],
+    "zstride":    [7, 1000, "zfetch stream strides per second"],
+    "zissued":    [7, 1000, "zfetch prefetches issued per second"],
+    "zactive":    [7, 1000, "zfetch prefetches active per second"],
 }
 
 v = {}
@@ -164,6 +174,8 @@ hdr = ["time", "read", "ddread", "ddh%", "dmread", "dmh%", 
"pread", "ph%",
        "size", "c", "avail"]
 xhdr = ["time", "mfu", "mru", "mfug", "mrug", "unc", "eskip", "mtxmis",
         "dread", "pread", "read"]
+zhdr = ["time", "ztotal", "zhits", "zahead", "zpast", "zmisses", "zmax",
+        "zfuture", "zstride", "zissued", "zactive"]
 sint = 1               # Default interval is 1 second
 count = 1              # Default count is 1
 hdr_intr = 20          # Print header every 20 lines of output
@@ -188,6 +200,8 @@ if sys.platform.startswith('freebsd'):
 
         k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
              if ctl.type != sysctl.CTLTYPE_NODE]
+        k += [ctl for ctl in sysctl.filter('kstat.zfs.misc.zfetchstats')
+             if ctl.type != sysctl.CTLTYPE_NODE]
 
         if not k:
             sys.exit(1)
@@ -199,19 +213,28 @@ if sys.platform.startswith('freebsd'):
                 continue
 
             name, value = s.name, s.value
-            # Trims 'kstat.zfs.misc.arcstats' from the name
-            kstat[name[24:]] = int(value)
+
+            if "arcstats" in name:
+                # Trims 'kstat.zfs.misc.arcstats' from the name
+                kstat[name[24:]] = int(value)
+            else:
+                kstat["zfetch_" + name[27:]] = int(value)
 
 elif sys.platform.startswith('linux'):
     def kstat_update():
         global kstat
 
-        k = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
+        k1 = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
 
-        if not k:
+        k2 = ["zfetch_" + line.strip() for line in
+             open('/proc/spl/kstat/zfs/zfetchstats')]
+
+        if k1 is None or k2 is None:
             sys.exit(1)
 
-        del k[0:2]
+        del k1[0:2]
+        del k2[0:2]
+        k = k1 + k2
         kstat = {}
 
         for s in k:
@@ -239,6 +262,7 @@ def usage():
     sys.stderr.write("\t -v : List all possible field headers and definitions"
                      "\n")
     sys.stderr.write("\t -x : Print extended stats\n")
+    sys.stderr.write("\t -z : Print zfetch stats\n")
     sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
     sys.stderr.write("\t -o : Redirect output to the specified file\n")
     sys.stderr.write("\t -s : Override default field separator with custom "
@@ -357,6 +381,7 @@ def init():
     global count
     global hdr
     global xhdr
+    global zhdr
     global opfile
     global sep
     global out
@@ -368,15 +393,17 @@ def init():
     xflag = False
     hflag = False
     vflag = False
+    zflag = False
     i = 1
 
     try:
         opts, args = getopt.getopt(
             sys.argv[1:],
-            "axo:hvs:f:p",
+            "axzo:hvs:f:p",
             [
                 "all",
                 "extended",
+                "zfetch",
                 "outfile",
                 "help",
                 "verbose",
@@ -410,13 +437,15 @@ def init():
             i += 1
         if opt in ('-p', '--parsable'):
             pretty_print = False
+        if opt in ('-z', '--zfetch'):
+            zflag = True
         i += 1
 
     argv = sys.argv[i:]
     sint = int(argv[0]) if argv else sint
     count = int(argv[1]) if len(argv) > 1 else (0 if len(argv) > 0 else 1)
 
-    if hflag or (xflag and desired_cols):
+    if hflag or (xflag and zflag) or ((zflag or xflag) and desired_cols):
         usage()
 
     if vflag:
@@ -425,6 +454,9 @@ def init():
     if xflag:
         hdr = xhdr
 
+    if zflag:
+        hdr = zhdr
+
     update_hdr_intr()
 
     # check if L2ARC exists
@@ -569,6 +601,17 @@ def calculate():
     v["el2mru"] = d["evict_l2_eligible_mru"] // sint
     v["el2inel"] = d["evict_l2_ineligible"] // sint
     v["mtxmis"] = d["mutex_miss"] // sint
+    v["ztotal"] = (d["zfetch_hits"] + d["zfetch_future"] + d["zfetch_stride"] +
+                   d["zfetch_past"] + d["zfetch_misses"]) // sint
+    v["zhits"] = d["zfetch_hits"] // sint
+    v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) // sint
+    v["zpast"] = d["zfetch_past"] // sint
+    v["zmisses"] = d["zfetch_misses"] // sint
+    v["zmax"] = d["zfetch_max_streams"] // sint
+    v["zfuture"] = d["zfetch_future"] // sint
+    v["zstride"] = d["zfetch_stride"] // sint
+    v["zissued"] = d["zfetch_io_issued"] // sint
+    v["zactive"] = d["zfetch_io_active"] // sint
 
     if l2exist:
         v["l2hits"] = d["l2_hits"] // sint
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c 
b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c
index 4a6cfbf8c05c..fe43e2ab971e 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.c
@@ -22,6 +22,7 @@
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  *
  * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2023, Klara Inc.
  */
 
 /*
@@ -231,28 +232,6 @@ fmd_prop_get_int32(fmd_hdl_t *hdl, const char *name)
        if (strcmp(name, "spare_on_remove") == 0)
                return (1);
 
-       if (strcmp(name, "io_N") == 0 || strcmp(name, "checksum_N") == 0)
-               return (10);    /* N = 10 events */
-
-       return (0);
-}
-
-int64_t
-fmd_prop_get_int64(fmd_hdl_t *hdl, const char *name)
-{
-       (void) hdl;
-
-       /*
-        * These can be looked up in mp->modinfo->fmdi_props
-        * For now we just hard code for phase 2. In the
-        * future, there can be a ZED based override.
-        */
-       if (strcmp(name, "remove_timeout") == 0)
-               return (15ULL * 1000ULL * 1000ULL * 1000ULL);   /* 15 sec */
-
-       if (strcmp(name, "io_T") == 0 || strcmp(name, "checksum_T") == 0)
-               return (1000ULL * 1000ULL * 1000ULL * 600ULL);  /* 10 min */
-
        return (0);
 }
 
@@ -535,20 +514,31 @@ fmd_serd_exists(fmd_hdl_t *hdl, const char *name)
        return (fmd_serd_eng_lookup(&mp->mod_serds, name) != NULL);
 }
 
-void
-fmd_serd_reset(fmd_hdl_t *hdl, const char *name)
+int
+fmd_serd_active(fmd_hdl_t *hdl, const char *name)
 {
        fmd_module_t *mp = (fmd_module_t *)hdl;
        fmd_serd_eng_t *sgp;
 
        if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
                zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name);
-               return;
+               return (0);
        }
+       return (fmd_serd_eng_fired(sgp) || !fmd_serd_eng_empty(sgp));
+}
 
-       fmd_serd_eng_reset(sgp);
+void
+fmd_serd_reset(fmd_hdl_t *hdl, const char *name)
+{
+       fmd_module_t *mp = (fmd_module_t *)hdl;
+       fmd_serd_eng_t *sgp;
 
-       fmd_hdl_debug(hdl, "serd_reset %s", name);
+       if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
+               zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name);
+       } else {
+               fmd_serd_eng_reset(sgp);
+               fmd_hdl_debug(hdl, "serd_reset %s", name);
+       }
 }
 
 int
@@ -556,16 +546,21 @@ fmd_serd_record(fmd_hdl_t *hdl, const char *name, 
fmd_event_t *ep)
 {
        fmd_module_t *mp = (fmd_module_t *)hdl;
        fmd_serd_eng_t *sgp;
-       int err;
 
        if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
                zed_log_msg(LOG_ERR, "failed to add record to SERD engine '%s'",
                    name);
                return (0);
        }
-       err = fmd_serd_eng_record(sgp, ep->ev_hrt);
+       return (fmd_serd_eng_record(sgp, ep->ev_hrt));
+}
+
+void
+fmd_serd_gc(fmd_hdl_t *hdl)
+{
+       fmd_module_t *mp = (fmd_module_t *)hdl;
 
-       return (err);
+       fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL);
 }
 
 /* FMD Timers */
@@ -579,7 +574,7 @@ _timer_notify(union sigval sv)
        const fmd_hdl_ops_t *ops = mp->mod_info->fmdi_ops;
        struct itimerspec its;
 
-       fmd_hdl_debug(hdl, "timer fired (%p)", ftp->ft_tid);
+       fmd_hdl_debug(hdl, "%s timer fired (%p)", mp->mod_name, ftp->ft_tid);
 
        /* disarm the timer */
        memset(&its, 0, sizeof (struct itimerspec));
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h 
b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h
index b940d0d395ec..8471feecf33f 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_api.h
@@ -151,7 +151,6 @@ extern void fmd_hdl_vdebug(fmd_hdl_t *, const char *, 
va_list);
 extern void fmd_hdl_debug(fmd_hdl_t *, const char *, ...);
 
 extern int32_t fmd_prop_get_int32(fmd_hdl_t *, const char *);
-extern int64_t fmd_prop_get_int64(fmd_hdl_t *, const char *);
 
 #define        FMD_STAT_NOALLOC        0x0     /* fmd should use caller's 
memory */
 #define        FMD_STAT_ALLOC          0x1     /* fmd should allocate stats 
memory */
@@ -195,10 +194,12 @@ extern size_t fmd_buf_size(fmd_hdl_t *, fmd_case_t *, 
const char *);
 extern void fmd_serd_create(fmd_hdl_t *, const char *, uint_t, hrtime_t);
 extern void fmd_serd_destroy(fmd_hdl_t *, const char *);
 extern int fmd_serd_exists(fmd_hdl_t *, const char *);
+extern int fmd_serd_active(fmd_hdl_t *, const char *);
 extern void fmd_serd_reset(fmd_hdl_t *, const char *);
 extern int fmd_serd_record(fmd_hdl_t *, const char *, fmd_event_t *);
 extern int fmd_serd_fired(fmd_hdl_t *, const char *);
 extern int fmd_serd_empty(fmd_hdl_t *, const char *);
+extern void fmd_serd_gc(fmd_hdl_t *);
 
 extern id_t fmd_timer_install(fmd_hdl_t *, void *, fmd_event_t *, hrtime_t);
 extern void fmd_timer_remove(fmd_hdl_t *, id_t);
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c 
b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c
index 0bb2c535f094..f942e62b3f48 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c
@@ -310,8 +310,9 @@ fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
 }
 
 void
-fmd_serd_eng_gc(fmd_serd_eng_t *sgp)
+fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg)
 {
+       (void) arg;
        fmd_serd_elem_t *sep, *nep;
        hrtime_t hrt;
 
diff --git a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h 
b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h
index 25b6888e61f2..80ff9a3b25b8 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h
+++ b/sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h
@@ -77,7 +77,7 @@ extern int fmd_serd_eng_fired(fmd_serd_eng_t *);
 extern int fmd_serd_eng_empty(fmd_serd_eng_t *);
 
 extern void fmd_serd_eng_reset(fmd_serd_eng_t *);
-extern void fmd_serd_eng_gc(fmd_serd_eng_t *);
+extern void fmd_serd_eng_gc(fmd_serd_eng_t *, void *);
 
 #ifdef __cplusplus
 }
diff --git a/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c 
b/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c
index f6ba334a3ba3..e0ad00800add 100644
--- a/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c
+++ b/sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c
@@ -23,6 +23,7 @@
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2023, Klara Inc.
  */
 
 #include <stddef.h>
@@ -47,11 +48,16 @@
 #define        DEFAULT_CHECKSUM_T      600     /* seconds */
 #define        DEFAULT_IO_N            10      /* events */
 #define        DEFAULT_IO_T            600     /* seconds */
+#define        DEFAULT_SLOW_IO_N       10      /* events */
+#define        DEFAULT_SLOW_IO_T       30      /* seconds */
+
+#define        CASE_GC_TIMEOUT_SECS    43200   /* 12 hours */
 
 /*
- * Our serd engines are named 'zfs_<pool_guid>_<vdev_guid>_{checksum,io}'.  
This
- * #define reserves enough space for two 64-bit hex values plus the length of
- * the longest string.
+ * Our serd engines are named in the following format:
+ *     'zfs_<pool_guid>_<vdev_guid>_{checksum,io,slow_io}'
+ * This #define reserves enough space for two 64-bit hex values plus the
+ * length of the longest string.
  */
 #define        MAX_SERDLEN     (16 * 2 + sizeof ("zfs___checksum"))
 
@@ -68,6 +74,7 @@ typedef struct zfs_case_data {
        int             zc_pool_state;
        char            zc_serd_checksum[MAX_SERDLEN];
        char            zc_serd_io[MAX_SERDLEN];
+       char            zc_serd_slow_io[MAX_SERDLEN];
        int             zc_has_remove_timer;
 } zfs_case_data_t;
 
@@ -114,7 +121,8 @@ zfs_de_stats_t zfs_stats = {
        { "resource_drops", FMD_TYPE_UINT64, "resource related ereports" }
 };
 
-static hrtime_t zfs_remove_timeout;
+/* wait 15 seconds after a removal */
+static hrtime_t zfs_remove_timeout = SEC2NSEC(15);
 
 uu_list_pool_t *zfs_case_pool;
*** 11838 LINES SKIPPED ***

Reply via email to