summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2012-11-24 13:16:49 +0000
committeravg <avg@FreeBSD.org>2012-11-24 13:16:49 +0000
commit33414b4bd59d7562c297d9c62b893e6ff9efcad9 (patch)
treef98fbee288e4263dde35cc76d63b94ea6ae48744
parent3b9e3d08850b51f4ccd48ad7bf3e63ab28fdaf27 (diff)
downloadFreeBSD-src-33414b4bd59d7562c297d9c62b893e6ff9efcad9.zip
FreeBSD-src-33414b4bd59d7562c297d9c62b893e6ff9efcad9.tar.gz
spa_import_rootpool: initialize ub_version before calling spa_config_parse
... because the latter makes some decision based on the version. This is especially important for raidz vdevs. This is similar to what spa_load does. This is not an issue for upstream because they do not seem to support using raidz as a root pool. Reported by: Andrei Lavreniyuk <andy.lavr@gmail.com> Tested by: Andrei Lavreniyuk <andy.lavr@gmail.com> MFC after: 6 days
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
index 8eb79b3..7ab0372 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
@@ -3838,6 +3838,14 @@ spa_import_rootpool(const char *name)
spa_remove(spa);
}
spa = spa_add(pname, config, NULL);
+
+ /*
+ * Set spa_ubsync.ub_version as it can be used in vdev_alloc()
+ * via spa_version().
+ */
+ if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
+ &spa->spa_ubsync.ub_version) != 0)
+ spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL;
} else if ((spa = spa_lookup(name)) == NULL) {
cmn_err(CE_NOTE, "Cannot find the pool label for '%s'",
name);
OpenPOWER on IntegriCloud