]> git.proxmox.com Git - zfsonlinux.git/blame - spl-patches/0003-Add-pool-state-proc-entry-SUSPENDED-pools-SPL.patch
bump version to 0.7.11-pve1~bpo1
[zfsonlinux.git] / spl-patches / 0003-Add-pool-state-proc-entry-SUSPENDED-pools-SPL.patch
CommitLineData
f0371a1b
SI
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Tony Hutter <hutter2@llnl.gov>
3Date: Wed, 15 Aug 2018 09:39:55 -0700
4Subject: [PATCH] Add pool state /proc entry, "SUSPENDED" pools (SPL)
5
6(This is the SPL backported code from f0ed6c744)
7
81. Add a proc entry to display the pool's state:
9
10$ cat /proc/spl/kstat/zfs/tank/state
11ONLINE
12
13This is done without using the spa config locks, so it will
14never hang.
15
162. Fix 'zpool status' and 'zpool list -o health' output to print
17"SUSPENDED" instead of "ONLINE" for suspended pools.
18
19Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
20Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
21Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
22Signed-off-by: Tony Hutter <hutter2@llnl.gov>
23Closes #7331
24Closes #7563
25
26Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
27---
28 include/sys/kstat.h | 2 +-
29 module/spl/spl-kstat.c | 4 ++--
30 2 files changed, 3 insertions(+), 3 deletions(-)
31
32diff --git a/include/sys/kstat.h b/include/sys/kstat.h
33index 2018019..b8aa7ed 100644
34--- a/include/sys/kstat.h
35+++ b/include/sys/kstat.h
36@@ -72,7 +72,7 @@
37 #define KSTAT_FLAG_UNSUPPORTED \
38 (KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \
39 KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT)
40-
41+#define KSTAT_FLAG_NO_HEADERS 0x80
42
43 #define KS_MAGIC 0x9d9d9d9d
44
45diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c
46index 6970fcc..f9b9015 100644
47--- a/module/spl/spl-kstat.c
48+++ b/module/spl/spl-kstat.c
49@@ -388,7 +388,8 @@ kstat_seq_start(struct seq_file *f, loff_t *pos)
50
51 ksp->ks_snaptime = gethrtime();
52
53- if (!n && kstat_seq_show_headers(f))
54+ if (!(ksp->ks_flags & KSTAT_FLAG_NO_HEADERS) && !n &&
55+ kstat_seq_show_headers(f))
56 return (NULL);
57
58 if (n >= ksp->ks_ndata)
59@@ -538,7 +539,6 @@ __kstat_create(const char *ks_module, int ks_instance, const char *ks_name,
60 ASSERT(ks_module);
61 ASSERT(ks_instance == 0);
62 ASSERT(ks_name);
63- ASSERT(!(ks_flags & KSTAT_FLAG_UNSUPPORTED));
64
65 if ((ks_type == KSTAT_TYPE_INTR) || (ks_type == KSTAT_TYPE_IO))
66 ASSERT(ks_ndata == 1);
67--
682.11.0
69