svn commit: r341100 - stable/11/sys/kern

Eric van Gyzen vangyzen at FreeBSD.org
Tue Nov 27 22:34:00 UTC 2018


Author: vangyzen
Date: Tue Nov 27 22:33:58 2018
New Revision: 341100
URL: https://svnweb.freebsd.org/changeset/base/341100

Log:
  MFC r340409
  
  Make no assertions about lock state when the scheduler is stopped.
  
  Change the assert paths in rm, rw, and sx locks to match the lock
  and unlock paths.  I did this for mutexes in r306346.
  
  Reported by:	Travis Lane <tlane at isilon.com>
  Sponsored by:	Dell EMC Isilon

Modified:
  stable/11/sys/kern/kern_rmlock.c
  stable/11/sys/kern/kern_rwlock.c
  stable/11/sys/kern/kern_sx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_rmlock.c
==============================================================================
--- stable/11/sys/kern/kern_rmlock.c	Tue Nov 27 22:32:34 2018	(r341099)
+++ stable/11/sys/kern/kern_rmlock.c	Tue Nov 27 22:33:58 2018	(r341100)
@@ -740,7 +740,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch
 {
 	int count;
 
-	if (panicstr != NULL)
+	if (SCHEDULER_STOPPED())
 		return;
 	switch (what) {
 	case RA_LOCKED:

Modified: stable/11/sys/kern/kern_rwlock.c
==============================================================================
--- stable/11/sys/kern/kern_rwlock.c	Tue Nov 27 22:32:34 2018	(r341099)
+++ stable/11/sys/kern/kern_rwlock.c	Tue Nov 27 22:33:58 2018	(r341100)
@@ -1378,7 +1378,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con
 {
 	const struct rwlock *rw;
 
-	if (panicstr != NULL)
+	if (SCHEDULER_STOPPED())
 		return;
 
 	rw = rwlock2rw(c);

Modified: stable/11/sys/kern/kern_sx.c
==============================================================================
--- stable/11/sys/kern/kern_sx.c	Tue Nov 27 22:32:34 2018	(r341099)
+++ stable/11/sys/kern/kern_sx.c	Tue Nov 27 22:33:58 2018	(r341100)
@@ -1312,7 +1312,7 @@ _sx_assert(const struct sx *sx, int what, const char *
 	int slocked = 0;
 #endif
 
-	if (panicstr != NULL)
+	if (SCHEDULER_STOPPED())
 		return;
 	switch (what) {
 	case SA_SLOCKED:


More information about the svn-src-stable mailing list