freebsd-dev/sys
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
..
amd64 Add linux_preadv() and linux_pwritev() syscalls to Linuxulator. 2017-02-24 20:04:02 +00:00
arm Convert PCIe Hot Plug to using pci_request_feature 2017-02-25 06:11:59 +00:00
arm64 Load the new sp_el0 with interrupts disabled in fork_trampoline. If an 2017-02-15 14:56:47 +00:00
boot Remove control+r handling from geliboot's pwgets() 2017-02-24 16:52:57 +00:00
bsm
cam Add reporting SAS protocol, in case we ever have one. 2017-02-25 14:36:24 +00:00
cddl MFV 314243 2017-02-25 14:45:54 +00:00
compat Add linux_preadv() and linux_pwritev() syscalls to Linuxulator. 2017-02-24 20:04:02 +00:00
conf zfs: clean up unused files and definitions 2017-02-24 07:53:56 +00:00
contrib Add 7265D firmware. 2017-02-22 04:42:02 +00:00
crypto Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
ddb Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
dev Use ctl_queue_sense() to implement sense data reporting. 2017-02-25 14:24:29 +00:00
fs Do not leak mount references for dying threads. 2017-02-25 10:38:18 +00:00
gdb
geom - Allow different slicers for different flash types to be registered 2017-02-22 10:21:39 +00:00
gnu
i386 Add linux_preadv() and linux_pwritev() syscalls to Linuxulator. 2017-02-24 20:04:02 +00:00
isa Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
kern Do not leak mount references for dying threads. 2017-02-25 10:38:18 +00:00
kgssapi
libkern sys: Replace zero with NULL for pointers. 2017-02-22 02:35:59 +00:00
mips Convert PCIe Hot Plug to using pci_request_feature 2017-02-25 06:11:59 +00:00
modules zfs: clean up unused files and definitions 2017-02-24 07:53:56 +00:00
net sys: Replace zero with NULL for pointers. 2017-02-22 02:35:59 +00:00
net80211 [net80211] validate VHT IEs. 2017-02-20 04:04:59 +00:00
netgraph mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION. 2017-01-20 00:02:11 +00:00
netinet TCP window updates are only sent if the window can be increased by at 2017-02-23 18:14:36 +00:00
netinet6 Remove IPsec related PCB code from SCTP. 2017-02-13 11:37:52 +00:00
netipsec For translated packets do not adjust UDP checksum if it is zero. 2017-02-18 19:53:37 +00:00
netnatm
netpfil sys: Replace zero with NULL for pointers. 2017-02-22 02:35:59 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Avoid NULL dereference in a couple of sysctl handlers in ibcore. 2017-02-23 07:48:58 +00:00
opencrypto
powerpc Convert PCIe Hot Plug to using pci_request_feature 2017-02-25 06:11:59 +00:00
riscv Implement atomic_fcmpset_*() for RISC-V. 2017-02-05 00:32:12 +00:00
rpc add svcpool_close to handle killed nfsd threads 2017-02-14 17:49:08 +00:00
security Audit 'fd' and 'cmd' arguments to fcntl(2), and when generating BSM, 2016-11-22 00:41:24 +00:00
sparc64 Convert PCIe Hot Plug to using pci_request_feature 2017-02-25 06:11:59 +00:00
sys Do not leak mount references for dying threads. 2017-02-25 10:38:18 +00:00
teken
tests
tools Replace using of objdump with elfdump 2017-01-10 18:46:40 +00:00
ufs Do not leak mount references for dying threads. 2017-02-25 10:38:18 +00:00
vm Properly handle possible underflow in vm_fault_prefault(). 2017-02-24 08:09:16 +00:00
x86 Do not use ULL suffix. Cast to uint64_t where the suffix is needed, 2017-02-25 10:32:49 +00:00
xdr
xen "Buses" is the preferred plural of "bus" 2017-01-15 17:54:01 +00:00
Makefile Remove pc98 support completely. 2017-01-28 02:22:15 +00:00