From: Chunwei Chen Date: Fri, 23 Jan 2015 07:01:03 +0000 (+0800) Subject: Fix spl_hostid module parameter X-Git-Tag: spl-0.6.4~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=086476f92005506cb07e75f889e8ddb69026e842;p=spl 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 Signed-off-by: Brian Behlendorf Closes #427 --- diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index b706cce..4056c4e 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); }