Commit 504bfc8
Fix multihost stale cache file import
When the multihost property is enabled it should be impossible to
import an active pool even using the force (-f) option. This patch
prevents a forced import from succeeding when importing with a
stale cache file.
The root cause of the problem is that the kernel modules trusted
the hostid provided in configuration. This is always correct when
the configuration is generated by scanning for the pool. However,
when using an existing cache file the hostid could be stale which
would result in the activity check being skipped.
Resolve the issue by always using the hostid read from the label
configuration where the best uberblock was found.
Reviewed-by: Olaf Faaland <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #6933
Closes #69711 parent 53a8cbd commit 504bfc8
File tree
4 files changed
+26
-9
lines changed- module/zfs
- tests/zfs-tests/tests/functional/mmp
4 files changed
+26
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2341 | 2341 | | |
2342 | 2342 | | |
2343 | 2343 | | |
2344 | | - | |
| 2344 | + | |
| 2345 | + | |
2345 | 2346 | | |
2346 | 2347 | | |
2347 | 2348 | | |
| |||
2358 | 2359 | | |
2359 | 2360 | | |
2360 | 2361 | | |
2361 | | - | |
2362 | 2362 | | |
2363 | 2363 | | |
2364 | 2364 | | |
| |||
2384 | 2384 | | |
2385 | 2385 | | |
2386 | 2386 | | |
2387 | | - | |
| 2387 | + | |
| 2388 | + | |
2388 | 2389 | | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
2389 | 2393 | | |
2390 | 2394 | | |
2391 | 2395 | | |
| |||
2651 | 2655 | | |
2652 | 2656 | | |
2653 | 2657 | | |
2654 | | - | |
| 2658 | + | |
2655 | 2659 | | |
2656 | 2660 | | |
2657 | 2661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | | - | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
114 | | - | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
0 commit comments