summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/spa_config.c
diff options
context:
space:
mode:
authorGeorge Wilson <george.wilson@delphix.com>2013-03-24 15:59:22 -0800
committerChristopher Siden <chris.siden@delphix.com>2013-03-24 16:59:22 -0700
commitfb02ae025247e3b662600e5a9c1b4c33ecab7d72 (patch)
tree4d3bd887643a0e01c96c623d6bf1c6f4e796bf39 /usr/src/uts/common/fs/zfs/spa_config.c
parent490d05b9daa0e60fbb3aac647c556408e88228bd (diff)
downloadillumos-gate-fb02ae025247e3b662600e5a9c1b4c33ecab7d72.tar.gz
3639 zpool.cache should skip over readonly pools
3640 want automatic devid updates Reviewed by: Eric Schrock <eric.schrock@delphix.com> Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Basil Crow <basil.crow@delphix.com> Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src/uts/common/fs/zfs/spa_config.c')
-rw-r--r--usr/src/uts/common/fs/zfs/spa_config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/zfs/spa_config.c b/usr/src/uts/common/fs/zfs/spa_config.c
index 366545035d..b113ce9e0c 100644
--- a/usr/src/uts/common/fs/zfs/spa_config.c
+++ b/usr/src/uts/common/fs/zfs/spa_config.c
@@ -222,7 +222,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);