X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fspa_config.c;fp=module%2Fzfs%2Fspa_config.c;h=5e5b4052620d1e69b6beedd9606e5842efc30387;hb=c61f97f426b7e0bc106b7e6795d4ea2ecbd2384d;hp=849ae46ec6c8f0594fd2999c6e629e174d4ca279;hpb=78d7a5d780d44708a6e8835a0f1e185cc8ee3dfb;p=zfs.git diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 849ae46..5e5b405 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);