6716241 Changing hostid, by moving in a new sysinit file, panics a zfs root file system
authorLin Ling <Lin.Ling@Sun.COM>
Fri, 26 Sep 2008 09:29:22 -0700
changeset 7706 75cbbfb9ce50
parent 7705 a1475c6145e2
child 7707 e1c04e8c2986
6716241 Changing hostid, by moving in a new sysinit file, panics a zfs root file system
usr/src/uts/common/fs/zfs/spa.c
--- a/usr/src/uts/common/fs/zfs/spa.c	Fri Sep 26 07:59:19 2008 -0700
+++ b/usr/src/uts/common/fs/zfs/spa.c	Fri Sep 26 09:29:22 2008 -0700
@@ -1141,8 +1141,8 @@
 			goto out;
 		}
 
-		if (nvlist_lookup_uint64(newconfig, ZPOOL_CONFIG_HOSTID,
-		    &hostid) == 0) {
+		if (!spa_is_root(spa) && nvlist_lookup_uint64(newconfig,
+		    ZPOOL_CONFIG_HOSTID, &hostid) == 0) {
 			char *hostname;
 			unsigned long myhostid = 0;
 
@@ -1154,7 +1154,7 @@
 			    (unsigned long)hostid != myhostid) {
 				cmn_err(CE_WARN, "pool '%s' could not be "
 				    "loaded as it was last accessed by "
-				    "another system (host: %s hostid: 0x%lx).  "
+				    "another system (host: %s hostid: 0x%lx). "
 				    "See: http://www.sun.com/msg/ZFS-8000-EY",
 				    spa->spa_name, hostname,
 				    (unsigned long)hostid);