Read spl_hostid module parameter before gethostid()

If spl_hostid is set via module parameter, it's likely different from
gethostid(). Therefore, the userspace tool should read it first before
falling back to gethostid().

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3034
This commit is contained in:
Chunwei Chen
2015-01-23 16:05:04 +08:00
committed by Brian Behlendorf
parent aa2ef419e4
commit 53698a453d
4 changed files with 28 additions and 3 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ check_status(nvlist_t *config, boolean_t isimport, zpool_errata_t *erratap)
uint64_t suspended;
uint64_t hostid = 0;
uint64_t errata = 0;
unsigned long system_hostid = gethostid() & 0xffffffff;
unsigned long system_hostid = get_system_hostid();
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
&version) == 0);