mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
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:
committed by
Brian Behlendorf
parent
aa2ef419e4
commit
53698a453d
@@ -1917,7 +1917,7 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,
|
||||
} else if (state != POOL_STATE_EXPORTED &&
|
||||
!(flags & ZFS_IMPORT_ANY_HOST)) {
|
||||
uint64_t hostid = 0;
|
||||
unsigned long system_hostid = gethostid() & 0xffffffff;
|
||||
unsigned long system_hostid = get_system_hostid();
|
||||
|
||||
(void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID,
|
||||
&hostid);
|
||||
|
||||
Reference in New Issue
Block a user