summaryrefslogtreecommitdiffstats
path: root/module/spl/spl-generic.c
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2015-01-23 15:01:03 +0800
committerBrian Behlendorf <[email protected]>2015-02-04 16:42:25 -0800
commit086476f92005506cb07e75f889e8ddb69026e842 (patch)
tree063e06ba1ab295814d57caa06acf23b811d40fbe /module/spl/spl-generic.c
parentc7db36a3c4ac768a74bd86778cc3535bdcb8d526 (diff)
Fix spl_hostid module parameter
Currently, spl_hostid module parameter doesn't do anything, because it will always be overwritten when calling into hostid_read(). Instead, we should only call into hostid_read() when spl_hostid is not zero, just as the comment describes. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #427
Diffstat (limited to 'module/spl/spl-generic.c')
-rw-r--r--module/spl/spl-generic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c
index b706ccecd..4056c4e42 100644
--- a/module/spl/spl-generic.c
+++ b/module/spl/spl-generic.c
@@ -467,13 +467,15 @@ zone_get_hostid(void *zone)
if (first) {
first = 0;
+ spl_hostid &= HW_HOSTID_MASK;
/*
* Get the hostid if it was not passed as a module parameter.
* Try reading the /etc/hostid file directly.
*/
- if (hostid_read())
+ if (spl_hostid == 0 && hostid_read())
spl_hostid = 0;
+
printk(KERN_NOTICE "SPL: using hostid 0x%08x\n",
(unsigned int) spl_hostid);
}