Compare commits
4 Commits
aa99285dda
...
88fd6e053b
| Author | SHA1 | Date | |
|---|---|---|---|
| 88fd6e053b | |||
| 4f818e9880 | |||
| 310afb0d19 | |||
| 0f9a07b53e |
Vendored
+10
@@ -1,3 +1,13 @@
|
||||
zfs-linux (2.2.0-pve2) bookworm; urgency=medium
|
||||
|
||||
* avoid error from zfs-mount when /etc/exports.d does not exist (yet)
|
||||
|
||||
* ensure vdev_stat struct layout compat between 2.1 and 2.2, avoiding
|
||||
false-positive detection of the non-allocating feature from 2.2 when the
|
||||
kernel still used the 2.1 module.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Sun, 12 Nov 2023 16:02:02 +0100
|
||||
|
||||
zfs-linux (2.2.0-pve1) bookworm; urgency=medium
|
||||
|
||||
* update ZFS to 2.2.0
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: siv0 <github@nomore.at>
|
||||
Date: Tue, 31 Oct 2023 21:57:54 +0100
|
||||
Subject: [PATCH] Fix nfs_truncate_shares without /etc/exports.d
|
||||
|
||||
Calling nfs_reset_shares on Linux prints a warning:
|
||||
`failed to lock /etc/exports.d/zfs.exports.lock: No such file or
|
||||
directory`
|
||||
when /etc/exports.d does not exist. The directory gets created, when a
|
||||
filesystem is actually exported through nfs_toggle_share and
|
||||
nfs_init_share. The truncation of /etc/exports.d/zfs.exports happens
|
||||
unconditionally when calling `zfs mount -a` (via zfs_do_mount and
|
||||
share_mount in `cmd/zfs/zfs_main.c`).
|
||||
|
||||
Fixing the issue only in the Linux part, since the exports file on
|
||||
freebsd is in `/etc/zfs/`, which seems present on 2 FreeBSD systems I
|
||||
have access to (through `/etc/zfs/compatibility.d/`), while a Debian
|
||||
box does not have the directory even if `/usr/sbin/exportfs` is
|
||||
present through the `nfs-kernel-server` package.
|
||||
|
||||
The code for exports_available is copied from nfs_available above.
|
||||
|
||||
Fixes: ede037cda73675f42b1452187e8dd3438fafc220
|
||||
("Make zfs-share service resilient to stale exports")
|
||||
|
||||
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
|
||||
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
|
||||
Closes #15369
|
||||
Closes #15468
|
||||
(cherry picked from commit 41e55b476bcfc90f1ad81c02c5375367fdace9e9)
|
||||
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
|
||||
---
|
||||
lib/libshare/os/linux/nfs.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/lib/libshare/os/linux/nfs.c b/lib/libshare/os/linux/nfs.c
|
||||
index 004946b0c..3dce81840 100644
|
||||
--- a/lib/libshare/os/linux/nfs.c
|
||||
+++ b/lib/libshare/os/linux/nfs.c
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
|
||||
static boolean_t nfs_available(void);
|
||||
+static boolean_t exports_available(void);
|
||||
|
||||
typedef int (*nfs_shareopt_callback_t)(const char *opt, const char *value,
|
||||
void *cookie);
|
||||
@@ -539,6 +540,8 @@ nfs_commit_shares(void)
|
||||
static void
|
||||
nfs_truncate_shares(void)
|
||||
{
|
||||
+ if (!exports_available())
|
||||
+ return;
|
||||
nfs_reset_shares(ZFS_EXPORTS_LOCK, ZFS_EXPORTS_FILE);
|
||||
}
|
||||
|
||||
@@ -566,3 +569,18 @@ nfs_available(void)
|
||||
|
||||
return (avail == 1);
|
||||
}
|
||||
+
|
||||
+static boolean_t
|
||||
+exports_available(void)
|
||||
+{
|
||||
+ static int avail;
|
||||
+
|
||||
+ if (!avail) {
|
||||
+ if (access(ZFS_EXPORTS_DIR, F_OK) != 0)
|
||||
+ avail = -1;
|
||||
+ else
|
||||
+ avail = 1;
|
||||
+ }
|
||||
+
|
||||
+ return (avail == 1);
|
||||
+}
|
||||
@@ -0,0 +1,75 @@
|
||||
From 28be24aefc13b11e4c96e172cf2685994e03150d Mon Sep 17 00:00:00 2001
|
||||
From: Tony Hutter <hutter2@llnl.gov>
|
||||
Date: Thu, 9 Nov 2023 16:43:35 -0800
|
||||
Subject: [PATCH] Workaround UBSAN errors for variable arrays
|
||||
|
||||
This gets around UBSAN errors when using arrays at the end of
|
||||
structs. It converts some zero-length arrays to variable length
|
||||
arrays and disables UBSAN checking on certain modules.
|
||||
|
||||
It is based off of the patch from #15460.
|
||||
|
||||
Addresses: #15145
|
||||
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
|
||||
Co-authored-by: Tony Hutter <hutter2@llnl.gov>
|
||||
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
include/os/linux/spl/sys/kmem_cache.h | 2 +-
|
||||
include/sys/vdev_raidz_impl.h | 4 ++--
|
||||
module/Kbuild.in | 4 ++++
|
||||
3 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/os/linux/spl/sys/kmem_cache.h b/include/os/linux/spl/sys/kmem_cache.h
|
||||
index 20eeadc46..82d50b603 100644
|
||||
--- a/include/os/linux/spl/sys/kmem_cache.h
|
||||
+++ b/include/os/linux/spl/sys/kmem_cache.h
|
||||
@@ -108,7 +108,7 @@ typedef struct spl_kmem_magazine {
|
||||
uint32_t skm_refill; /* Batch refill size */
|
||||
struct spl_kmem_cache *skm_cache; /* Owned by cache */
|
||||
unsigned int skm_cpu; /* Owned by cpu */
|
||||
- void *skm_objs[0]; /* Object pointers */
|
||||
+ void *skm_objs[]; /* Object pointers */
|
||||
} spl_kmem_magazine_t;
|
||||
|
||||
typedef struct spl_kmem_obj {
|
||||
diff --git a/include/sys/vdev_raidz_impl.h b/include/sys/vdev_raidz_impl.h
|
||||
index c1037fa12..73c26dff1 100644
|
||||
--- a/include/sys/vdev_raidz_impl.h
|
||||
+++ b/include/sys/vdev_raidz_impl.h
|
||||
@@ -130,7 +130,7 @@ typedef struct raidz_row {
|
||||
uint64_t rr_offset; /* Logical offset for *_io_verify() */
|
||||
uint64_t rr_size; /* Physical size for *_io_verify() */
|
||||
#endif
|
||||
- raidz_col_t rr_col[0]; /* Flexible array of I/O columns */
|
||||
+ raidz_col_t rr_col[]; /* Flexible array of I/O columns */
|
||||
} raidz_row_t;
|
||||
|
||||
typedef struct raidz_map {
|
||||
@@ -139,7 +139,7 @@ typedef struct raidz_map {
|
||||
int rm_nskip; /* RAIDZ sectors skipped for padding */
|
||||
int rm_skipstart; /* Column index of padding start */
|
||||
const raidz_impl_ops_t *rm_ops; /* RAIDZ math operations */
|
||||
- raidz_row_t *rm_row[0]; /* flexible array of rows */
|
||||
+ raidz_row_t *rm_row[]; /* flexible array of rows */
|
||||
} raidz_map_t;
|
||||
|
||||
|
||||
diff --git a/module/Kbuild.in b/module/Kbuild.in
|
||||
index c13217159..b9c284a24 100644
|
||||
--- a/module/Kbuild.in
|
||||
+++ b/module/Kbuild.in
|
||||
@@ -488,6 +488,10 @@ zfs-$(CONFIG_ARM64) += $(addprefix zfs/,$(ZFS_OBJS_ARM64))
|
||||
zfs-$(CONFIG_PPC) += $(addprefix zfs/,$(ZFS_OBJS_PPC_PPC64))
|
||||
zfs-$(CONFIG_PPC64) += $(addprefix zfs/,$(ZFS_OBJS_PPC_PPC64))
|
||||
|
||||
+UBSAN_SANITIZE_zap_leaf.o := n
|
||||
+UBSAN_SANITIZE_zap_micro.o := n
|
||||
+UBSAN_SANITIZE_sa.o := n
|
||||
+
|
||||
# Suppress incorrect warnings from versions of objtool which are not
|
||||
# aware of x86 EVEX prefix instructions used for AVX512.
|
||||
OBJECT_FILES_NON_STANDARD_vdev_raidz_math_avx512bw.o := y
|
||||
--
|
||||
2.39.2
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Date: Sun, 12 Nov 2023 15:52:25 +0100
|
||||
Subject: [PATCH] zpool status: tighten bounds for noalloc stat availabillity
|
||||
|
||||
When running zfs 2.2.0 userspace utilities with a kernel that still
|
||||
has 2.1.13 modules zpool status adds `(non-allocating)` next to the
|
||||
disk name of a single-disk pool.
|
||||
|
||||
The reason for this seems to be that the patch adding the `vs_pspace` field was
|
||||
backported, but the one adding `vs_noalloc` was not.
|
||||
|
||||
Itself that is not a problem, but in 2.2 `noalloc` was added before `psspace`,
|
||||
so the struct layout between 2.1.13 and 2.2.0 do NOT match anymore...
|
||||
|
||||
I.e., the struct looks like the following at the end for ZFS 2.1.x:
|
||||
|
||||
```
|
||||
typedef struct vdev_stat {
|
||||
hrtime_t vs_timestamp; /* time since vdev load */
|
||||
// snip
|
||||
uint64_t vs_logical_ashift; /* vdev_logical_ashift */
|
||||
uint64_t vs_physical_ashift; /* vdev_physical_ashift */
|
||||
uint64_t vs_pspace; /* physical capacity */
|
||||
} vdev_stat_t;
|
||||
```
|
||||
|
||||
And like the following on ZFS 2.2.x:
|
||||
```
|
||||
typedef struct vdev_stat {
|
||||
hrtime_t vs_timestamp; /* time since vdev load */
|
||||
// snip
|
||||
uint64_t vs_logical_ashift; /* vdev_logical_ashift */
|
||||
uint64_t vs_physical_ashift; /* vdev_physical_ashift */
|
||||
uint64_t vs_noalloc; /* allocations halted? */
|
||||
uint64_t vs_pspace; /* physical capacity */
|
||||
} vdev_stat_t;
|
||||
```
|
||||
|
||||
Resulting in 2.2.x user-space tooling interpreting the `vs_pspace` field from
|
||||
the 2.1.x kernel module as `vs_noalloc` field.
|
||||
|
||||
For now, work-around that discrepancy by coupling the availability of
|
||||
the vs_noalloc field with the one of the vs_pspace one, as when both
|
||||
are returned from the module we can be sure that our struct layout
|
||||
matches again.
|
||||
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
cmd/zpool/zpool_main.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
|
||||
index 5507f9d3f..98970abfe 100644
|
||||
--- a/cmd/zpool/zpool_main.c
|
||||
+++ b/cmd/zpool/zpool_main.c
|
||||
@@ -2478,7 +2478,8 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
|
||||
|
||||
if (vs->vs_scan_removing != 0) {
|
||||
(void) printf(gettext(" (removing)"));
|
||||
- } else if (VDEV_STAT_VALID(vs_noalloc, vsc) && vs->vs_noalloc != 0) {
|
||||
+ } else if (VDEV_STAT_VALID(vs_pspace, vsc)
|
||||
+ && VDEV_STAT_VALID(vs_noalloc, vsc) && vs->vs_noalloc != 0) {
|
||||
(void) printf(gettext(" (non-allocating)"));
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -9,3 +9,6 @@
|
||||
0009-arc-stat-summary-guard-access-to-l2arc-MFU-MRU-stats.patch
|
||||
0010-zvol-Remove-broken-blk-mq-optimization.patch
|
||||
0011-Revert-zvol-Temporally-disable-blk-mq.patch
|
||||
0012-Fix-nfs_truncate_shares-without-etc-exports.d.patch
|
||||
0013-Workaround-UBSAN-errors-for-variable-arrays.patch
|
||||
0014-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch
|
||||
|
||||
Reference in New Issue
Block a user