Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Dec 2016 19:28:11 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r310615 - head/sys/kern
Message-ID:  <201612261928.uBQJSBos067449@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Dec 26 19:28:10 2016
New Revision: 310615
URL: https://svnweb.freebsd.org/changeset/base/310615

Log:
  Change knlist_destroy() to assert that knlist is empty instead of
  accepting the wrong state and printing warning.  Do not obliterate
  kl_lock and kl_unlock pointers, they are often useful for post-mortem
  analysis.
  
  Reviewed by:	markj
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks
  X-Differential revision:	https://reviews.freebsd.org/D8898

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c	Mon Dec 26 19:27:12 2016	(r310614)
+++ head/sys/kern/kern_event.c	Mon Dec 26 19:28:10 2016	(r310615)
@@ -2249,17 +2249,8 @@ void
 knlist_destroy(struct knlist *knl)
 {
 
-#ifdef INVARIANTS
-	/*
-	 * if we run across this error, we need to find the offending
-	 * driver and have it call knlist_clear or knlist_delete.
-	 */
-	if (!SLIST_EMPTY(&knl->kl_list))
-		printf("WARNING: destroying knlist w/ knotes on it!\n");
-#endif
-
-	knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL;
-	SLIST_INIT(&knl->kl_list);
+	KASSERT(KNLIST_EMPTY(knl),
+	    ("destroying knlist %p with knotes on it", knl));
 }
 
 void



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