]> git.proxmox.com Git - mirror_spl.git/commitdiff
Fix spl_hostid module parameter
authorChunwei Chen <tuxoko@gmail.com>
Fri, 23 Jan 2015 07:01:03 +0000 (15:01 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 5 Feb 2015 00:42:25 +0000 (16:42 -0800)
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 <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #427

module/spl/spl-generic.c

index b706ccecd3ee95f66ef9f7b6537dbdfa996b2cb5..4056c4e425110f3e5eb37253f67ea34660bec383 100644 (file)
@@ -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);
        }