When a vnode is vgone()'d its v_ops is replaced with dead_vnode_ops.
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 25 May 2006 01:20:07 +0000 (01:20 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 25 May 2006 01:20:07 +0000 (01:20 +0000)
commit6a99d723c848c7be8d423373f0ea1eeddc462021
tree1af327721dc3309afca108e3bd6281b107fc4b53
parent014958fd5acb0f0c6771a44dd31f06961c78984c
When a vnode is vgone()'d its v_ops is replaced with dead_vnode_ops.
dead_vnode_ops replaces VOP_LOCK with a dummy routine that just returns
TRUE.

This blows up anyone actually trying to access the vnode by improperly
returning a successful lock which then panics the machine when the caller
tries to unlock it.  This also screws up VOP_LOCK vs vx_lock() interactions
and can theoretically create other problems.

Normally vgone()'d vnodes have no references and this isn't a problem.
The two notable exceptions are (1) when revoke() is called on a device
(i.e. tty), and (2) when a procfs or linprocfs vnode is destroyed due
to a process exit while another process is accessing it.

Remove dead_lock().  Dead vnodes revert to defaultops which implement
the expected lockmgr lock.
sys/vfs/deadfs/dead_vnops.c