Fix a serious bug in cache_inval_vp()'s TAILQ iteration through v_namecache.
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 9 Mar 2005 05:16:23 +0000 (05:16 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 9 Mar 2005 05:16:23 +0000 (05:16 +0000)
commit2aefb2c50e72bbcddbbd9182fa4fe145f59a0f73
tree1eaff2730dba19ccfc6525cb6b561a0c4a2da080
parent296880fdb559aed0b4fa749ad9152a8495c1c542
Fix a serious bug in cache_inval_vp()'s TAILQ iteration through v_namecache.
It was iterating using nc_entry instead of nc_vnode.  The effect was,
typically, to deadlock in the namecache locking code but could also result
in the namecache topology becoming confused.

Add code to detect and report vnode ripouts during the scan.  This case can
occur in certain rare circumstances because a held namecache structure only
prevents it from being removed from the topology, it does not prevent it
from being disassociated from a vnode.

Reported-by: Michael van Tellingen <michael@synantics.nl> and
     Hiten Pandya <hmp@backplane.com>
sys/kern/vfs_cache.c