From e8b8b834b4bc8960f553e50589329e5c3b6d7fe5 Mon Sep 17 00:00:00 2001 From: Alexander Leidinger Date: Fri, 23 Feb 2007 22:29:24 +0000 Subject: [PATCH] MFp4 (part of 114132): - Fix a LOR caused by holding emul_lock and proctree_lock at once. Submitted by: rdivacky --- sys/compat/linux/linux_emul.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 116eb114f43d..2a42f708bb60 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -168,19 +168,20 @@ linux_proc_exit(void *arg __unused, struct proc *p) /* reparent all procs that are not a thread leader to initproc */ if (em->shared->group_pid != p->p_pid) { - sx_xlock(&proctree_lock); - wakeup(initproc); + child_clear_tid = em->child_clear_tid; + EMUL_UNLOCK(&emul_lock); + sx_xlock(&proctree_lock); + wakeup(initproc); PROC_LOCK(p); proc_reparent(p, initproc); p->p_sigparent = SIGCHLD; PROC_UNLOCK(p); - sx_xunlock(&proctree_lock); + sx_xunlock(&proctree_lock); + } else { + child_clear_tid = em->child_clear_tid; + EMUL_UNLOCK(&emul_lock); } - child_clear_tid = em->child_clear_tid; - - EMUL_UNLOCK(&emul_lock); - EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_REMOVE(em, threads);