From 39db4c6e0f2530819aa92982573ff288566f706e Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 17 Apr 2007 17:57:34 +0000 Subject: [PATCH] Ignore hostid check for root-on-ZFS configurations. Making hostid available before the root is mounted is tricky and having it in /boot/ is not really desire. Reported by: Zephiris --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c | 6 +++++- sys/contrib/opensolaris/uts/common/fs/zfs/spa.c | 6 +++++- 2 files changed, 10 insertions(+), 2 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 0e649bb90957..f8d9465d83ed 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c @@ -598,8 +598,12 @@ spa_load(spa_t *spa, nvlist_t *config, spa_load_state_t state, int mosconfig) goto out; } + /* + * hostid is set after the root file system is mounted, so + * ignore the check until it's done. + */ if (nvlist_lookup_uint64(newconfig, ZPOOL_CONFIG_HOSTID, - &hostid) == 0) { + &hostid) == 0 && root_mounted()) { char *hostname; unsigned long myhostid = 0; diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c index 0e649bb90957..f8d9465d83ed 100644 --- a/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c +++ b/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c @@ -598,8 +598,12 @@ spa_load(spa_t *spa, nvlist_t *config, spa_load_state_t state, int mosconfig) goto out; } + /* + * hostid is set after the root file system is mounted, so + * ignore the check until it's done. + */ if (nvlist_lookup_uint64(newconfig, ZPOOL_CONFIG_HOSTID, - &hostid) == 0) { + &hostid) == 0 && root_mounted()) { char *hostname; unsigned long myhostid = 0;