diff options
author | csjp <csjp@FreeBSD.org> | 2006-09-13 15:47:53 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2006-09-13 15:47:53 +0000 |
commit | 3927aa447494d5f1b31035c64ecc9b2ae7401a52 (patch) | |
tree | e4d3a57db87a8c696a03f1c6aac1aafd0e633115 /sys/kern/kern_exit.c | |
parent | ef665c74ec677be31f3aaa3bd125b18eeae71fe3 (diff) | |
download | FreeBSD-src-3927aa447494d5f1b31035c64ecc9b2ae7401a52.zip FreeBSD-src-3927aa447494d5f1b31035c64ecc9b2ae7401a52.tar.gz |
Back out one of the Giant removals from revision 1.272. Giant was not here to
protect the vnode, it was present to synchronize access to TTY session
information between exit(2) and the TTY code. While we are here, note that
Giant is required for TTY protection.
Clue from: bde
Discussed with: jhb
MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index a13c6f3..5b937b4 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -301,13 +301,13 @@ retry: vmspace_exit(td); + mtx_lock(&Giant); /* XXX TTY */ sx_xlock(&proctree_lock); if (SESS_LEADER(p)) { struct session *sp; sp = p->p_session; if (sp->s_ttyvp) { - locked = VFS_LOCK_GIANT(sp->s_ttyvp->v_mount); /* * Controlling process. * Signal foreground pgrp, @@ -353,7 +353,6 @@ retry: * that the session once had a controlling terminal. * (for logging and informational purposes) */ - VFS_UNLOCK_GIANT(locked); } SESS_LOCK(p->p_session); sp->s_leader = NULL; @@ -362,6 +361,7 @@ retry: fixjobc(p, p->p_pgrp, 0); sx_xunlock(&proctree_lock); (void)acct_process(td); + mtx_unlock(&Giant); #ifdef KTRACE /* * Drain any pending records on the thread and release the trace |