Fix a race between the namecache and the vnode recycler. A vnode cannot be
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 8 May 2008 01:41:07 +0000 (01:41 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 8 May 2008 01:41:07 +0000 (01:41 +0000)
commitc0c70b27fa5d25d0b596dbf158062c286d149dba
tree4c312786c4b404a310c72d10d934b3a9b3fd52c7
parent39b0a1afb784a19b233094ad3a4bce7f18b841de
Fix a race between the namecache and the vnode recycler.  A vnode cannot be
recycled if it's namecache entry represents a directory with locked children.
The various VOP_N*() functions require the parent dvp to be stable.

The main fix is in vrecycle() (kern/vfs_subr.c).  Do not vgone() the vnode
if we can't clean out the children.

Also create an API to assert that the parent dvp is stable, and make it
vhold/vdrop the dvp.

The race primarily effected HAMMER which uses the VOP_N*() API.
sys/kern/uipc_usrreq.c
sys/kern/vfs_cache.c
sys/kern/vfs_subr.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/sys/namecache.h