Date: Mon, 17 Jun 2013 09:49:07 +0000 (UTC) From: Lawrence Stewart <lstewart@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251838 - head/sys/kern Message-ID: <201306170949.r5H9n7oc020728@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lstewart Date: Mon Jun 17 09:49:07 2013 New Revision: 251838 URL: http://svnweb.freebsd.org/changeset/base/251838 Log: The fix committed in r250951 replaced the reported panic with a deadlock... gold star for me. EVENTHANDLER_DEREGISTER() attempts to acquire the lock which is held by the event handler framework while executing event handler functions, leading to deadlock. Move EVENTHANDLER_DEREGISTER() to alq_load_handler() and thus deregister the ALQ shutdown_pre_sync handler at module unload time, which takes care of the originally reported panic and fixes the deadlock introduced in r250951. Reported by: Luiz Otavio O Souza MFC after: 3 days X-MFC with: 250951 Modified: head/sys/kern/kern_alq.c Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Mon Jun 17 08:57:09 2013 (r251837) +++ head/sys/kern/kern_alq.c Mon Jun 17 09:49:07 2013 (r251838) @@ -229,8 +229,6 @@ ald_shutdown(void *arg, int howto) { struct alq *alq; - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, alq_eventhandler_tag); - ALD_LOCK(); /* Ensure no new queues can be created. */ @@ -938,6 +936,8 @@ alq_load_handler(module_t mod, int what, if (LIST_FIRST(&ald_queues) == NULL) { ald_shutingdown = 1; ALD_UNLOCK(); + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, + alq_eventhandler_tag); ald_shutdown(NULL, 0); mtx_destroy(&ald_mtx); } else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306170949.r5H9n7oc020728>