Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2002 18:25:40 -0800
From:      Jonathan Mini <mini@haikugeek.com>
To:        "Steven G. Kargl" <kargl@troutmask.apl.washington.edu>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: two lock order reversals
Message-ID:  <20020402182540.B80692@stylus.haikugeek.com>
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
References:  <200204030111.g331BDCP033703@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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

<baka^ni> desolation... despair... plastic forks...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020402182540.B80692>