freebsd-dev/sys/cddl
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
..
boot/zfs Mark two things as unused (since they are only sometimes used) and 2017-12-03 04:55:33 +00:00
compat/opensolaris Fix 32-bit buildworld for i386 after r334320. 2018-05-29 13:43:16 +00:00
contrib/opensolaris Break recursion involving getnewvnode and zfs_rmnode. 2018-06-07 18:59:32 +00:00
dev Revert r326083, it doesn't behave as expected. 2018-06-03 03:53:11 +00:00