freebsd-dev/sys
Josh Paetzel 14127f5b21 This change addresses 4 bugs in ZFS exposed by Richard Kojedzinszky's
crash.sh script attached to FreeNAS bug 4109:
https://bugs.freenas.org/issues/4109

Three are in the snapshot layer:
a) AVG explains in his notes: https://wiki.freebsd.org/AvgVfsSolarisVsFreeBSD

"VOP_INACTIVE must not do any destructive actions to a vnode
and its filesystem node, nor invalidate them in any way."
gfs_vop_inactive and zfsctl_snapshot_inactive did just that. In
OpenSolaris VOP_INACTIVE is much closer to FreeBSD's VOP_RECLAIM.
Rename & move them to gfs_vop_reclaim and zfsctl_snapshot_reclaim
and merge in the requisite vnode_destroy from zfsctl_common_reclaim.

b) gfs_lookup_dot and various zfsctl functions do not honor the
FreeBSD VFS convention of only locking from the root downward. When
looking up ".." the convention is to drop the current leaf vnode lock before
acquiring the directory vnode and then subsequently re-acquiring the lock on the
leaf vnode. This fixes that in all the places that our exercised by crash.sh.

c) The snapshot may already be unmounted when the directory vnode is reclaimed.
Check for this case and return.

One in the common layer:
d) Callers of traverse expect the reference to the vnode passed in to be
maintained. Don't release it.

This last one may be an unclear contract. There may in fact be some callers that
do expect the reference to be dropped on success in addition to callers that
expect it to be released. In this case a further audit of the callers is needed
and a consensus on the correct behavior.

PR:	184677
Submitted by:	kmacy
Reviewed by:	delphij, will, avg
MFC after:	2 weeks
Sponsored by:	iXsystems
2014-10-25 17:42:44 +00:00
..
amd64 Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that 2014-10-24 19:58:24 +00:00
arm Add an iicbus_reset() method to bcm2835_bsc. While it is generally not 2014-10-24 22:06:21 +00:00
boot Provide a character device allowing us to access BERI memory regions. 2014-10-22 11:30:03 +00:00
bsm
cam Add support for 12/16-byte EUI and 16-byte NAA IDs. 2014-10-25 17:07:35 +00:00
cddl This change addresses 4 bugs in ZFS exposed by Richard Kojedzinszky's 2014-10-25 17:42:44 +00:00
compat Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
conf Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that 2014-10-24 19:58:24 +00:00
contrib Update the OFED Linux compatibility layer and 2014-10-15 13:40:29 +00:00
crypto Put the aesni_cipher_setup() and aesni_cipher_process() functions into 2014-06-24 06:55:49 +00:00
ddb ddb: ANSI-fy function declarations. 2014-10-12 18:01:52 +00:00
dev cxgbe(4): bump up PF4's share of some global resources. 2014-10-25 00:14:44 +00:00
fs Clip the settings for the NFS rsize, wsize mount options 2014-10-22 22:27:51 +00:00
gdb Add support for gdb's memory searching capabilities to our in-kernel gdb 2014-09-05 16:40:47 +00:00
geom Revert somewhat hackish geom_disk optimization, committed as part of r256880, 2014-10-25 15:16:19 +00:00
gnu reiserfs: Use signed i_nlink 2014-09-25 19:10:32 +00:00
i386 Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that 2014-10-24 19:58:24 +00:00
isa
kern Revert somewhat hackish geom_disk optimization, committed as part of r256880, 2014-10-25 15:16:19 +00:00
kgssapi
libkern Add a complete implementation of MurmurHash3. Tweak both implementations 2014-10-18 22:15:11 +00:00
mips Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
modules Add VirtIO console driver 2014-10-23 04:47:32 +00:00
net Remove redundant check and m_pullup() call. 2014-10-24 13:34:22 +00:00
net80211 Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
netgraph Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
netinet Fix a use of an uninitialized variable by makeing sure 2014-10-25 09:25:29 +00:00
netinet6 Remove redundant check and m_pullup() call. 2014-10-24 13:34:22 +00:00
netipsec Use a static callout to drive key_timehandler() instead of timeout(). 2014-10-23 20:43:16 +00:00
netnatm
netpfil Bump default dynamic limit to 16k entries. 2014-10-24 13:57:15 +00:00
netsmb Remove redundant unlock. 2014-04-17 12:22:08 +00:00
nfs Follow up to r225617. In order to maximize the re-usability of kernel code 2014-10-16 18:04:43 +00:00
nfsclient Follow up to r225617. In order to maximize the re-usability of kernel code 2014-10-16 18:04:43 +00:00
nfsserver Change NFS readdir() to only ignore cookies preceding the given offset for 2014-07-01 20:00:35 +00:00
nlm
ofed Update the network interface baudrate integer according to the actual 2014-10-24 16:39:01 +00:00
opencrypto Fix build for kernels without COMPAT_FREEBSD32. 2014-09-22 17:32:27 +00:00
pc98 Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that 2014-10-24 19:58:24 +00:00
powerpc Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that 2014-10-24 19:58:24 +00:00
rpc Merge the NFSv4.1 server code in projects/nfsv4.1-server over 2014-07-01 20:47:16 +00:00
security Replace dev_clone with cdevpriv(9) KPI in audit_pipe code. 2014-08-20 16:04:30 +00:00
sparc64 Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that 2014-10-24 19:58:24 +00:00
sys The current POSIX semaphore implementation stores the _has_waiters flag 2014-10-24 20:02:44 +00:00
teken
tools Allow the make_dtb script to work outside of a "make buildkernel" context 2014-08-30 22:39:15 +00:00
ufs Provide vfs suspension support only for filesystems which need it, take 2014-10-20 18:00:50 +00:00
vm Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
x86 xen: implement the privcmd user-space device 2014-10-22 17:07:20 +00:00
xdr
xen xen: implement the privcmd user-space device 2014-10-22 17:07:20 +00:00
Makefile Remove "pci" from CSCOPEDIRS. 2014-09-23 06:32:19 +00:00