diff options
author | Richard Yao <[email protected]> | 2013-03-11 21:16:36 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-04-14 09:04:41 -0700 |
commit | acf0ade362cb8b26d67770114ee6fa17816e6b65 (patch) | |
tree | fca1cd2bb9cabdfbe11e5daa5d32265ac365be6a /module/spl/spl-proc.c | |
parent | 3ceb71e8966e5f1895885eeaaa9354ffd940b490 (diff) |
Simplify hostid logic
There is plenty of compatibility code for a hw_hostid
that isn't used by anything. At the same time, there are apparently
issues with the current hostid logic. coredumb in #zfsonlinux on
freenode reported that Fedora 17 changes its hostid on every boot, which
required force importing his pool. A suggestion by wca was to adopt
FreeBSD's behavior, where it treats hostid as zero if /etc/hostid does
not exist
Adopting FreeBSD's behavior permits us to eliminate plenty of code,
including a userland helper that invokes the system's hostid as a
fallback.
Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #224
Diffstat (limited to 'module/spl/spl-proc.c')
-rw-r--r-- | module/spl/spl-proc.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index f25239aca..2bbc8d790 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -72,7 +72,6 @@ struct proc_dir_entry *proc_spl_kstat = NULL; #define CTL_VERSION CTL_UNNUMBERED /* Version */ #define CTL_HOSTID CTL_UNNUMBERED /* Host id by /usr/bin/hostid */ -#define CTL_HW_SERIAL CTL_UNNUMBERED /* HW serial number by hostid */ #define CTL_KALLSYMS CTL_UNNUMBERED /* kallsyms_lookup_name addr */ #define CTL_DEBUG_SUBSYS CTL_UNNUMBERED /* Debug subsystem */ @@ -129,7 +128,6 @@ enum { enum { CTL_VERSION = 1, /* Version */ CTL_HOSTID, /* Host id reported by /usr/bin/hostid */ - CTL_HW_SERIAL, /* Hardware serial number from hostid */ CTL_KALLSYMS, /* Address of kallsyms_lookup_name */ #ifdef DEBUG_LOG @@ -513,9 +511,6 @@ SPL_PROC_HANDLER(proc_dohostid) if (str == end) SRETURN(-EINVAL); - (void) snprintf(hw_serial, HW_HOSTID_LEN, "%lu", spl_hostid); - hw_serial[HW_HOSTID_LEN - 1] = '\0'; - *ppos += *lenp; } else { len = snprintf(str, sizeof(str), "%lx", spl_hostid); if (*ppos >= len) @@ -1058,14 +1053,6 @@ static struct ctl_table spl_table[] = { .mode = 0644, .proc_handler = &proc_dohostid, }, - { - CTL_NAME (CTL_HW_SERIAL) - .procname = "hw_serial", - .data = hw_serial, - .maxlen = sizeof(hw_serial), - .mode = 0444, - .proc_handler = &proc_dostring, - }, #ifndef HAVE_KALLSYMS_LOOKUP_NAME { CTL_NAME (CTL_KALLSYMS) |