freebsd-dev/sys/cddl/compat/opensolaris/kern
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
..
opensolaris_acl.c Don't panic when we read an empty ACL from ZFS. Apparently this may happen 2010-11-30 21:04:05 +00:00
opensolaris_atomic.c When arm 64-bit atomic ops are available, define ARM_HAVE_ATOMIC64. Use 2014-08-02 03:44:27 +00:00
opensolaris_cmn_err.c style(9) fixes 2013-06-29 23:39:38 +00:00
opensolaris_dtrace.c Remove sys/types.h include as per style (9) 2014-09-18 20:38:18 +00:00
opensolaris_kmem.c Refactor ZFS ARC reclaim checks and limits 2014-10-03 20:34:55 +00:00
opensolaris_kobj.c Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
opensolaris_kstat.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
opensolaris_lookup.c This change addresses 4 bugs in ZFS exposed by Richard Kojedzinszky's 2014-10-25 17:42:44 +00:00
opensolaris_misc.c Finally... Import the latest open-source ZFS version - (SPA) 28. 2011-02-27 19:41:40 +00:00
opensolaris_policy.c Finally... Import the latest open-source ZFS version - (SPA) 28. 2011-02-27 19:41:40 +00:00
opensolaris_string.c Finally... Import the latest open-source ZFS version - (SPA) 28. 2011-02-27 19:41:40 +00:00
opensolaris_sunddi.c Use proper lock in assertion. 2011-02-28 05:45:31 +00:00
opensolaris_sysevent.c Silence warnings about unsupoorted value types. 2011-05-27 08:34:31 +00:00
opensolaris_taskq.c opensolaris compat: add taskq_wait emulation 2013-11-28 19:17:11 +00:00
opensolaris_uio.c
opensolaris_vfs.c opensolaris compat: clear VI_MOUNT before returning if mount_snapshot fails 2012-11-04 14:27:31 +00:00
opensolaris_vm.c zfs: add zfs_freebsd_putpages 2013-11-29 15:39:39 +00:00
opensolaris_zone.c Finally... Import the latest open-source ZFS version - (SPA) 28. 2011-02-27 19:41:40 +00:00
opensolaris.c opensolaris compat / zfs: avoid early overflow in ddi_get_lbolt* 2011-06-04 07:02:06 +00:00