freebsd-dev/sys/cddl/contrib/opensolaris/uts
Benno Rice b3b11d6400 Break recursion involving getnewvnode and zfs_rmnode.
When we're at our vnode limit, getnewvnode will call into the vnode LRU
cache to free up vnodes. If the vnode we try to recycle is a ZFS vnode we
end up, eventually, in zfs_rmnode. If the ZFS vnode we're recycling
represents something with extended attributes, zfs_rmnode will call
zfs_zget which will attempt to allocate another vnode. If the next vnode we
try to recycle is also a ZFS vnode representing something with extended
attributes we can recurse further. This ends up being unbounded and can end
up overflowing the stack.

In order to avoid this, restructure zfs_rmnode to simply add the extended
attribute directory's object ID to the unlinked set, thus not requiring the
allocation of a vnode. We then schedule a task that calls zfs_unlinked_drain
which will do the work of properly marking the vnodes for unlinking.
zfs_unlinked_drain is also called on mount so these will be cleaned up
there.

Reviewed by:	avg, mav
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D15342
2018-06-07 18:59:32 +00:00
..
aarch64
arm
common Break recursion involving getnewvnode and zfs_rmnode. 2018-06-07 18:59:32 +00:00
intel Remove very old and unused signal information codes. 2018-03-27 20:57:51 +00:00
mips
powerpc Correct initialization of pc on powerpc. 2017-12-12 20:41:11 +00:00
riscv Add initial DTrace support for RISC-V. 2016-05-24 16:41:37 +00:00