Fix a race with the clearing of p->p_session->s_ttyvp. NULL the pointer
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 15 Jun 2004 00:30:55 +0000 (00:30 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 15 Jun 2004 00:30:55 +0000 (00:30 +0000)
commit1fbb5fc02ed745f6db412bca172867e990b9814d
tree84fe409ef01d242ed8efbdcbbc927113d4fd7a3b
parent9c6a54112590c6e525819a2af1467999f1ecac61
Fix a race with the clearing of p->p_session->s_ttyvp.  NULL the pointer
out before calling vrele() rather then after.

Fix a bug with v_opencount accounting on revoke().  The underlying device
was being closed properly but v_opencount was being decremented which causes
it to go negative when close() is called on the descriptor later on.  To
fix the bug we zero out v_opencount() when the underlying vnode's device
is disassociated and spec_close() now only decrements it when the device is
associated.

Reported-by: GeekGod
Testing-by: GeekGod, Hiten, David Rhodus.
sys/kern/kern_exit.c
sys/kern/vfs_subr.c
sys/kern/vfs_vnops.c
sys/vfs/specfs/spec_vnops.c