summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/spa_config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
index 849ae46ec..5e5b40526 100644
--- a/module/zfs/spa_config.c
+++ b/module/zfs/spa_config.c
@@ -225,7 +225,15 @@ spa_config_sync(spa_t *target, boolean_t removing, boolean_t postsysevent)
*/
nvl = NULL;
while ((spa = spa_next(spa)) != NULL) {
- if (spa == target && removing)
+ /*
+ * Skip over our own pool if we're about to remove
+ * ourselves from the spa namespace or any pool that
+ * is readonly. Since we cannot guarantee that a
+ * readonly pool would successfully import upon reboot,
+ * we don't allow them to be written to the cache file.
+ */
+ if ((spa == target && removing) ||
+ !spa_writeable(spa))
continue;
mutex_enter(&spa->spa_props_lock);