aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2023-12-02 00:11:25 +0000
committerMartin Matuska <mm@FreeBSD.org>2023-12-02 00:16:27 +0000
commitf5eac65412786da4c764f86eb1514817889e9764 (patch)
treec4a66a66e8fcc0ad4bac8dd7b3ee45fba077fe86
parentfaedeaf7377ba7253c281cf3315b17e0cb979075 (diff)
parentd99134be83753266b5f7a79738aeab5b08db1e35 (diff)
downloadsrc-f5eac6541278.tar.gz
src-f5eac6541278.zip
zfs: merge openzfs/zfs@d99134be8 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.14 Notable upstream pull request merges: #15395 1ca531971 Zpool can start allocating from metaslab before TRIMs have completed #15571 77b0c6f04 dnode_is_dirty: check dnode and its data for dirtiness Obtained from: OpenZFS OpenZFS tag: zfs-2.1.14 OpenZFS commit: d99134be83753266b5f7a79738aeab5b08db1e35
-rw-r--r--sys/contrib/openzfs/META2
-rwxr-xr-xsys/contrib/openzfs/copy-builtin28
-rw-r--r--sys/contrib/openzfs/module/zfs/vdev_trim.c28
-rw-r--r--sys/modules/zfs/zfs_config.h6
-rw-r--r--sys/modules/zfs/zfs_gitrev.h2
5 files changed, 26 insertions, 40 deletions
diff --git a/sys/contrib/openzfs/META b/sys/contrib/openzfs/META
index 2fc3da778489..6e199face590 100644
--- a/sys/contrib/openzfs/META
+++ b/sys/contrib/openzfs/META
@@ -1,7 +1,7 @@
Meta: 1
Name: zfs
Branch: 1.0
-Version: 2.1.13
+Version: 2.1.14
Release: 1
Release-Tags: relext
License: CDDL
diff --git a/sys/contrib/openzfs/copy-builtin b/sys/contrib/openzfs/copy-builtin
index cd6f259092ed..18cc741b58e7 100755
--- a/sys/contrib/openzfs/copy-builtin
+++ b/sys/contrib/openzfs/copy-builtin
@@ -43,32 +43,8 @@ config ZFS
If unsure, say N.
EOF
-add_after()
-{
- FILE="$1"
- MARKER="$2"
- NEW="$3"
-
- while IFS='' read -r LINE
- do
- printf "%s\n" "$LINE"
-
- if [ -n "$MARKER" ] && [ "$LINE" = "$MARKER" ]
- then
- printf "%s\n" "$NEW"
- MARKER=''
- if IFS='' read -r LINE
- then
- [ "$LINE" != "$NEW" ] && printf "%s\n" "$LINE"
- fi
- fi
- done < "$FILE" > "$FILE.new"
-
- mv "$FILE.new" "$FILE"
-}
-
-add_after "$KERNEL_DIR/fs/Kconfig" 'if BLOCK' 'source "fs/zfs/Kconfig"'
-add_after "$KERNEL_DIR/fs/Makefile" 'endif' 'obj-$(CONFIG_ZFS) += zfs/'
+sed -i '/source "fs\/ext2\/Kconfig\"/i\source "fs/zfs/Kconfig"' "$KERNEL_DIR/fs/Kconfig"
+echo 'obj-$(CONFIG_ZFS) += zfs/' >> "$KERNEL_DIR/fs/Makefile"
echo "$0: done. now you can build the kernel with ZFS support." >&2
echo "$0: make sure you enable ZFS support (CONFIG_ZFS) before building." >&2
diff --git a/sys/contrib/openzfs/module/zfs/vdev_trim.c b/sys/contrib/openzfs/module/zfs/vdev_trim.c
index 92daed48f3d5..c0ce2ac28dc5 100644
--- a/sys/contrib/openzfs/module/zfs/vdev_trim.c
+++ b/sys/contrib/openzfs/module/zfs/vdev_trim.c
@@ -23,6 +23,7 @@
* Copyright (c) 2016 by Delphix. All rights reserved.
* Copyright (c) 2019 by Lawrence Livermore National Security, LLC.
* Copyright (c) 2021 Hewlett Packard Enterprise Development LP
+ * Copyright 2023 RackTop Systems, Inc.
*/
#include <sys/spa.h>
@@ -572,6 +573,7 @@ vdev_trim_ranges(trim_args_t *ta)
uint64_t extent_bytes_max = ta->trim_extent_bytes_max;
uint64_t extent_bytes_min = ta->trim_extent_bytes_min;
spa_t *spa = vd->vdev_spa;
+ int error = 0;
ta->trim_start_time = gethrtime();
ta->trim_bytes_done = 0;
@@ -591,19 +593,32 @@ vdev_trim_ranges(trim_args_t *ta)
uint64_t writes_required = ((size - 1) / extent_bytes_max) + 1;
for (uint64_t w = 0; w < writes_required; w++) {
- int error;
-
error = vdev_trim_range(ta, VDEV_LABEL_START_SIZE +
rs_get_start(rs, ta->trim_tree) +
(w *extent_bytes_max), MIN(size -
(w * extent_bytes_max), extent_bytes_max));
if (error != 0) {
- return (error);
+ goto done;
}
}
}
- return (0);
+done:
+ /*
+ * Make sure all TRIMs for this metaslab have completed before
+ * returning. TRIM zios have lower priority over regular or syncing
+ * zios, so all TRIM zios for this metaslab must complete before the
+ * metaslab is re-enabled. Otherwise it's possible write zios to
+ * this metaslab could cut ahead of still queued TRIM zios for this
+ * metaslab causing corruption if the ranges overlap.
+ */
+ mutex_enter(&vd->vdev_trim_io_lock);
+ while (vd->vdev_trim_inflight[0] > 0) {
+ cv_wait(&vd->vdev_trim_io_cv, &vd->vdev_trim_io_lock);
+ }
+ mutex_exit(&vd->vdev_trim_io_lock);
+
+ return (error);
}
static void
@@ -922,11 +937,6 @@ vdev_trim_thread(void *arg)
}
spa_config_exit(spa, SCL_CONFIG, FTAG);
- mutex_enter(&vd->vdev_trim_io_lock);
- while (vd->vdev_trim_inflight[0] > 0) {
- cv_wait(&vd->vdev_trim_io_cv, &vd->vdev_trim_io_lock);
- }
- mutex_exit(&vd->vdev_trim_io_lock);
range_tree_destroy(ta.trim_tree);
diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h
index 95886fc74c39..ac4d2c79268f 100644
--- a/sys/modules/zfs/zfs_config.h
+++ b/sys/modules/zfs/zfs_config.h
@@ -1042,7 +1042,7 @@
/* #undef ZFS_IS_GPL_COMPATIBLE */
/* Define the project alias string. */
-#define ZFS_META_ALIAS "zfs-2.1.13-FreeBSD_geb62221ff"
+#define ZFS_META_ALIAS "zfs-2.1.14-FreeBSD_gd99134be8"
/* Define the project author. */
#define ZFS_META_AUTHOR "OpenZFS"
@@ -1072,10 +1072,10 @@
#define ZFS_META_NAME "zfs"
/* Define the project release. */
-#define ZFS_META_RELEASE "FreeBSD_geb62221ff"
+#define ZFS_META_RELEASE "FreeBSD_gd99134be8"
/* Define the project version. */
-#define ZFS_META_VERSION "2.1.13"
+#define ZFS_META_VERSION "2.1.14"
/* count is located in percpu_ref.data */
/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */
diff --git a/sys/modules/zfs/zfs_gitrev.h b/sys/modules/zfs/zfs_gitrev.h
index ee3c87929aeb..7aff8347044a 100644
--- a/sys/modules/zfs/zfs_gitrev.h
+++ b/sys/modules/zfs/zfs_gitrev.h
@@ -1 +1 @@
-#define ZFS_META_GITREV "zfs-2.1.13-0-geb62221ff"
+#define ZFS_META_GITREV "zfs-2.1.14-0-gd99134be8"