Go to file
Olaf Faaland 34ae0ae174 Make hostid consistent in user and kernel space
If no spl_hostid was set, and no /etc/hostid file existed, the user
and kernel would have different values for the hostid.

The kernel's would be 0.  User space's would depend on the libc
implementation.  On systems with glibc, it would be a generated value,
probably the first 4 bytes of an IP address (see man 3 gethostid and
comments above hostid_read in SPL for details).

This then causes the hostid stored in the labels and in the pool
config not to match the hostid userspace obtains from
get_system_hostid().

Since the kernel has no way to know the libc's generated hostid value,
it serves no purpose for ZFS to use the value.

This patch changes user space's get_system_hostid() to conform to the
kernel's method, first checking for the spl_hostid via sysfs, and then
reading from /etc/hostid directly.

It does not look up spl_hostid_path, because if that is set and the
file it pointed to exists, spl_hostid will reflect its contents.

It eliminates the call to libc's gethostid().

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #745
Closes #6279
2017-07-13 13:26:40 -04:00
.github Provide links to info about ZFS Buildbot options 2017-06-15 17:52:18 -07:00
cmd OpenZFS 8067 - zdb should be able to dump literal embedded block pointer 2017-07-07 11:28:01 -07:00
config Prevent dependencies on Debianized packages 2017-07-07 10:45:17 -07:00
contrib Fix initramfs hook for merged /usr/lib and /lib 2017-02-27 12:03:23 -08:00
etc zpool iostat/status -c improvements 2017-06-05 10:52:15 -07:00
include OpenZFS 6939 - add sysevents to zfs core for commands 2017-07-12 21:28:13 -07:00
lib Make hostid consistent in user and kernel space 2017-07-13 13:26:40 -04:00
man Add port of FreeBSD 'volmode' property 2017-07-12 13:05:37 -07:00
module OpenZFS 6939 - add sysevents to zfs core for commands 2017-07-12 21:28:13 -07:00
rpm zpool iostat/status -c improvements 2017-06-05 10:52:15 -07:00
scripts ZTS: minor typo and old default values 2017-07-03 14:21:12 -07:00
tests Add port of FreeBSD 'volmode' property 2017-07-12 13:05:37 -07:00
udev Fix spelling 2017-01-03 11:31:18 -06:00
.gitignore Improve gitignore 2017-05-25 10:14:13 -07:00
.gitmodules Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
AUTHORS Add a missing > to AUTHORS 2014-09-02 14:18:53 -07:00
COPYRIGHT Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
DISCLAIMER Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
META Tag 0.7.0-rc4 2017-05-05 10:33:40 -07:00
Makefile.am Prebaked scripts for zpool status/iostat -c 2017-04-21 09:27:04 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Add CONTRIBUTING information and templates 2016-12-09 12:48:12 -07:00
TEST Retire filebench testing 2017-06-01 06:24:28 -07:00
autogen.sh build: do not call boilerplate ourself 2013-04-02 10:55:20 -07:00
configure.ac zpool iostat/status -c improvements 2017-06-05 10:52:15 -07:00
copy-builtin Allow c99 when building ZFS in the kernel tree 2017-03-27 12:31:15 -07:00
zfs-script-config.sh.in zpool iostat/status -c improvements 2017-06-05 10:52:15 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

README.markdown

ZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the Illumos community.

ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers. And it's native!

Official Resources

Installation

Full documentation for installing ZoL on your favorite Linux distribution can be found at our site.

Contribute & Develop

We have a separate document with contribution guidelines.