]>
Commit | Line | Data |
---|---|---|
f0371a1b SI |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Tony Hutter <hutter2@llnl.gov> | |
3 | Date: Wed, 15 Aug 2018 09:39:55 -0700 | |
4 | Subject: [PATCH] Add pool state /proc entry, "SUSPENDED" pools (SPL) | |
5 | ||
6 | (This is the SPL backported code from f0ed6c744) | |
7 | ||
8 | 1. Add a proc entry to display the pool's state: | |
9 | ||
10 | $ cat /proc/spl/kstat/zfs/tank/state | |
11 | ONLINE | |
12 | ||
13 | This is done without using the spa config locks, so it will | |
14 | never hang. | |
15 | ||
16 | 2. Fix 'zpool status' and 'zpool list -o health' output to print | |
17 | "SUSPENDED" instead of "ONLINE" for suspended pools. | |
18 | ||
19 | Reviewed-by: Olaf Faaland <faaland1@llnl.gov> | |
20 | Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> | |
21 | Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> | |
22 | Signed-off-by: Tony Hutter <hutter2@llnl.gov> | |
23 | Closes #7331 | |
24 | Closes #7563 | |
25 | ||
26 | Signed-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 | ||
32 | diff --git a/include/sys/kstat.h b/include/sys/kstat.h | |
33 | index 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 | ||
45 | diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c | |
46 | index 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 | -- | |
68 | 2.11.0 | |
69 |