diff options
author | kib <kib@FreeBSD.org> | 2009-10-10 21:17:30 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-10-10 21:17:30 +0000 |
commit | 31d083f28a4a30350e3a9a373bc20d5e44c93d5d (patch) | |
tree | 436e0facb5cfcabd993027dada21c5c6e1bc4b4a /sys | |
parent | edf781a8157d148cc0bb8786425a0a55a751abcc (diff) | |
download | FreeBSD-src-31d083f28a4a30350e3a9a373bc20d5e44c93d5d.zip FreeBSD-src-31d083f28a4a30350e3a9a373bc20d5e44c93d5d.tar.gz |
Refine r195509, instead of checking that vnode type is VBAD, that is
set quite late in the revocation path, properly verify that vnode is
not doomed before calling VOP.
Reported and tested by: Harald Schmalzbauer <h.schmalzbauer omnilan de>
MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_exit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 39b48e0..b96cdbf 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -340,10 +340,10 @@ exit1(struct thread *td, int rv) if (ttyvp != NULL) { sx_xunlock(&proctree_lock); - vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); - if (ttyvp->v_type != VBAD) + if (vn_lock(ttyvp, LK_EXCLUSIVE) == 0) { VOP_REVOKE(ttyvp, REVOKEALL); - VOP_UNLOCK(ttyvp, 0); + VOP_UNLOCK(ttyvp, 0); + } sx_xlock(&proctree_lock); } } |