aboutsummaryrefslogtreecommitdiffstats
path: root/module/spl/spl-proc.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-07-10 15:24:52 -0400
committerBrian Behlendorf <[email protected]>2017-07-13 13:22:28 -0400
commitc93d9dff36470434a3677225b820c14986075706 (patch)
treef484dd6d44c7cca5415b492179afc0131089265f /module/spl/spl-proc.c
parentdfbd813ec7b452884f91f134b82f30c6bdcd670c (diff)
Don't cache the system hostid
Historically the SPL cached the system hostid the first time it was accessed. This was done to speed up subsequent accesses. But in practice the system host id is rarely accessed and its inconvenient that it doesn't promptly detect /etc/hostid configuration changes. Therefore, zone_get_hostid() has been updated to always refresh the system hostid reported. Reviewed-by: Olaf Faaland <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #626
Diffstat (limited to 'module/spl/spl-proc.c')
-rw-r--r--module/spl/spl-proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c
index d6159b4b6..bffbcc607 100644
--- a/module/spl/spl-proc.c
+++ b/module/spl/spl-proc.c
@@ -203,7 +203,8 @@ proc_dohostid(struct ctl_table *table, int write,
return (-EINVAL);
} else {
- len = snprintf(str, sizeof(str), "%lx", spl_hostid);
+ len = snprintf(str, sizeof(str), "%lx",
+ (unsigned long) zone_get_hostid(NULL));
if (*ppos >= len)
rc = 0;
else