FreeBSD src
Go to file
Josh Paetzel 029c0bfdbd MFV 314243
6676 Race between unique_insert() and unique_remove() causes ZFS fsid change

illumos/illumos-gate@40510e8eba
40510e8eba

https://www.illumos.org/issues/6676

  The fsid of zfs filesystems might change after reboot or remount. The problem seems to
  be caused by a race between unique_insert() and unique_remove(). The unique_remove()
  is called from dsl_dataset_evict() which is now an asynchronous thread. In a case the
  dsl_dataset_evict() thread is very slow and calls unique_remove() too late we will end
  up with changed fsid on zfs mount.

  This problem is very likely caused by #5056.

  Steps to Reproduce
  Note: I'm able to reproduce this always on a single core (virtual) machine. On multicore
  machines it is not so easy to reproduce.

# uname -a
SunOS openindiana 5.11 illumos-633aa80 i86pc i386 i86pc Solaris
# zfs create rpool/TEST
# FS=$(echo ::fsinfo | mdb -k | grep TEST | awk '{print $1}')
# echo $FS::print vfs_t vfs_fsid | mdb -k
vfs_fsid = {
    vfs_fsid.val = [ 0x54d7028a, 0x70311508 ]
}
# zfs umount rpool/TEST
# zfs mount rpool/TEST
# FS=$(echo ::fsinfo | mdb -k | grep TEST | awk '{print $1}')
# echo $FS::print vfs_t vfs_fsid | mdb -k
vfs_fsid = {
    vfs_fsid.val = [ 0xd9454e49, 0x6b36d08 ]
}
#

  Impact
  The persistent fsid (filesystem id) is essential for proper NFS functionality.
  If the fsid of a filesystem changes on remount (or after reboot) the NFS
  clients might not be able to automatically recover from such event and the
  manual remount of the NFS filesystems on every NFS client might be needed.

Author: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Dan Vatca <dan.vatca@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
2017-02-25 14:45:54 +00:00
bin Vendor import of OpenPAM Radula. 2017-02-19 21:00:46 +00:00
cddl Fix memory leaks in error cases in libdtrace. 2017-02-23 17:56:24 +00:00
contrib Add sem_clockwait_np() 2017-02-23 19:36:38 +00:00
crypto Only notify blacklistd for successful logins in auth.c 2017-02-19 20:35:39 +00:00
etc The ct driver was removed by r312910. 2017-02-23 16:42:48 +00:00
gnu Use SRCTOP/OBJTOP and simplify output using :H instead of "../" for directory 2017-02-11 20:12:54 +00:00
include Guard sem_clockwait_np() declaration with __BSD_VISIBLE 2017-02-24 14:37:55 +00:00
kerberos5 Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS 2017-01-02 19:03:01 +00:00
lib Don't convert ENOENT to nothing for individual lookup, just for the 2017-02-25 00:09:21 +00:00
libexec Fully handle the special encoding of GOT[1] on mips64. 2017-02-23 00:02:49 +00:00
release Fix the hardware.html build. 2017-02-16 22:29:37 +00:00
rescue Conditionally compile certain programs into rescue(8) if requested 2017-02-25 03:23:11 +00:00
sbin Make nvmecontrol logpage -p help list known pages. 2017-02-25 00:09:16 +00:00
secure Remove bdes(1) 2017-02-06 08:27:19 +00:00
share add jedec_ts.4 to the list of manual pages 2017-02-23 22:08:35 +00:00
sys MFV 314243 2017-02-25 14:45:54 +00:00
targets Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
tests Actually fix buildworlds other than i386/amd64/sparc64 after r313992 2017-02-23 04:26:17 +00:00
tools Fill MK_LIBTHR as far as lib/libthr is concerned 2017-02-25 03:44:51 +00:00
usr.bin make vi message catalogues build independent of locale 2017-02-23 14:39:51 +00:00
usr.sbin Parameterize out the length of struct filed->f_lasttime as MAXDATELEN 2017-02-25 00:12:29 +00:00
.arcconfig callsign isn't required anymore 2016-09-29 06:19:45 +00:00
.arclint phabricator related changes: 2015-04-20 20:33:22 +00:00
COPYRIGHT Bump copyright year. 2016-12-31 12:41:42 +00:00
LOCKS
MAINTAINERS Remove myself from kern_timeout.c yeah! 2016-07-27 20:37:32 +00:00
Makefile Import mandoc 1.4.1rc2 2017-02-19 17:41:20 +00:00
Makefile.inc1 Document why cat is a bootstrap tool. 2017-02-21 18:49:30 +00:00
Makefile.libcompat Use cross-NM (XNM) in compat32 build 2017-01-27 03:43:18 +00:00
ObsoleteFiles.inc Remove lib/libpam tests after they were removed from the source tree in r313975 2017-02-20 01:45:12 +00:00
README Vendor import of OpenPAM Radula. 2017-02-19 21:00:46 +00:00
UPDATING add UPDATING entry for r314048, re-work of .zfs code 2017-02-21 17:54:38 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html