From ee42d0a9657793cac6b18c55d2c1af4f26fbd857 Mon Sep 17 00:00:00 2001 From: David Malone Date: Sat, 5 Jan 2002 21:47:58 +0000 Subject: [PATCH] Release text vnode in exit() rather than wait(). Occasionally fifesystem problems could prevent the release from completing and this could result in init being blocked indefinitely. This was looked over by Matt ages ago. Approved by: dillon --- sys/kern/kern_exit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index b9e16413f987..51b77c4c0e3d 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -123,9 +123,7 @@ exit1(td, rv) struct proc *p = td->td_proc; register struct proc *q, *nq; register struct vmspace *vm; -#ifdef KTRACE struct vnode *vtmp; -#endif struct exitlist *ep; GIANT_REQUIRED; @@ -275,6 +273,14 @@ exit1(td, rv) vrele(vtmp); } #endif + /* + * Release reference to text vnode + */ + if ((vtmp = p->p_textvp) != NULL) { + p->p_textvp = NULL; + vrele(vtmp); + } + /* * Remove proc from allproc queue and pidhash chain. * Place onto zombproc. Unlink from parent's child list. @@ -575,12 +581,6 @@ wait1(td, uap, compat) */ (void)chgproccnt(p->p_ucred->cr_ruidinfo, -1, 0); - /* - * Release reference to text vnode - */ - if (p->p_textvp) - vrele(p->p_textvp); - /* * Finally finished with old proc entry. * Unlink it from its process group and free it.