Fix a race condition between nlookup and vnode reclamation. Even though the
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 30 Mar 2006 02:39:48 +0000 (02:39 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 30 Mar 2006 02:39:48 +0000 (02:39 +0000)
commit9b1b3591b52f7a230b7c6bf5be6d3634c1560f2c
tree5243fba7ffd1a1064bec1392eba0197a7cf53642
parent3a1706d4fad2fe3ce0d6dc1e669a73fa3c678ed2
Fix a race condition between nlookup and vnode reclamation.  Even though the
cache_lock() refs a vnode to prevent reclamation, it is possible for a vnode
to already be in the middle of a reclamation as of the time the lock is
obtained.  Adjust cache_get*() and cache_resolve*() to check for the
condition and de-resolve the ncp before returning.

Reported-by: joerg@britannica.bec.de
sys/kern/vfs_cache.c
sys/sys/namecache.h