Date: Tue, 15 Aug 2006 11:24:05 -0400 From: John Baldwin <jhb@freebsd.org> To: Roman Divacky <rdivacky@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 104026 for review Message-ID: <200608151124.05472.jhb@freebsd.org> In-Reply-To: <200608151354.k7FDs1Vn093614@repoman.freebsd.org> References: <200608151354.k7FDs1Vn093614@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 15 August 2006 09:54, Roman Divacky wrote: > http://perforce.freebsd.org/chv.cgi?CH=104026 > > Change 104026 by rdivacky@rdivacky_witten on 2006/08/15 13:53:34 > > Lock the emuldata in a case we just created it. > > Pointed out by: jhb > > Affected files ... > > .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_emul.c#7 edit > > Differences ... > > ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_emul.c#7 (text+ko) ==== > > @@ -100,6 +100,7 @@ > if (p == NULL) > panic("process not found in proc_init\n"); > p->p_emuldata = em; > + EMUL_LOCK(&emul_lock); > PROC_UNLOCK(p); > } else { > /* lookup the old one */ Actually, this won't be happy since emul_lock is an sx lock. Can't acquire an sx lock while holding a mutex since the sx lock might sleep. > @@ -129,6 +130,7 @@ > > > if (child != 0) { > + EMUL_UNLOCK(&emul_lock); > EMUL_SHARED_WLOCK(&emul_shared_lock); > LIST_INSERT_HEAD(&em->shared->threads, em, threads); > EMUL_SHARED_WUNLOCK(&emul_shared_lock); > -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608151124.05472.jhb>