From owner-freebsd-current Tue Apr 2 18:27:22 2002 Delivered-To: freebsd-current@freebsd.org Received: from 12-234-96-171.client.attbi.com (12-234-96-171.client.attbi.com [12.234.96.171]) by hub.freebsd.org (Postfix) with ESMTP id D4A3D37B419 for ; Tue, 2 Apr 2002 18:26:51 -0800 (PST) Received: by 12-234-96-171.client.attbi.com (Postfix, from userid 1000) id 4AABB64; Tue, 2 Apr 2002 18:25:41 -0800 (PST) Date: Tue, 2 Apr 2002 18:25:40 -0800 From: Jonathan Mini To: "Steven G. Kargl" Cc: freebsd-current@FreeBSD.ORG Subject: Re: two lock order reversals Message-ID: <20020402182540.B80692@stylus.haikugeek.com> References: <200204030111.g331BDCP033703@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200204030111.g331BDCP033703@troutmask.apl.washington.edu>; from kargl@troutmask.apl.washington.edu on Tue, Apr 02, 2002 at 05:11:13PM -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Steven G. Kargl [kargl@troutmask.apl.washington.edu] wrote : > lock order reversal > 1st 0xc02d9b40 eventhandler @ /usr/src/sys/kern/subr_eventhandler.c:163 > 2nd 0xc4050008 shutdown_post_sync @ /usr/src/sys/kern/subr_eventhandler.c:116 [ ... ] > I believe the second is known, but the first appears > to be related to the recent eventhandler locking. Sorry about that. Index: kern/subr_eventhandler.c =================================================================== RCS file: /usr/cvs/src/sys/kern/subr_eventhandler.c,v retrieving revision 1.16 diff -u -r1.16 subr_eventhandler.c --- sys/kern/subr_eventhandler.c 2 Apr 2002 04:18:54 -0000 1.16 +++ sys/kern/subr_eventhandler.c 3 Apr 2002 02:21:29 -0000 @@ -101,11 +101,11 @@ sx_init(&list->el_lock, name); list->el_flags = EHE_INITTED; } + mtx_unlock(&eventhandler_mutex); /* allocate an entry for this handler, populate it */ if ((eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER, M_NOWAIT)) == NULL) { - mtx_unlock(&eventhandler_mutex); return(NULL); } eg->func = func; @@ -125,7 +125,6 @@ if (ep == NULL) TAILQ_INSERT_TAIL(&list->el_entries, &eg->ee, ee_link); EHE_UNLOCK(list); - mtx_unlock(&eventhandler_mutex); return(&eg->ee); } -- Jonathan Mini mini@haikugeek.com desolation... despair... plastic forks... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message