svn commit: r302925 - stable/10/sys/kern

Mark Johnston markj at FreeBSD.org
Sat Jul 16 02:55:03 UTC 2016


Author: markj
Date: Sat Jul 16 02:55:02 2016
New Revision: 302925
URL: https://svnweb.freebsd.org/changeset/base/302925

Log:
  MFC r302346:
  Ensure that spinlock sections are balanced even after a panic.

Modified:
  stable/10/sys/kern/kern_mutex.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_mutex.c
==============================================================================
--- stable/10/sys/kern/kern_mutex.c	Sat Jul 16 02:53:52 2016	(r302924)
+++ stable/10/sys/kern/kern_mutex.c	Sat Jul 16 02:55:02 2016	(r302925)
@@ -658,8 +658,15 @@ thread_lock_flags_(struct thread *td, in
 	i = 0;
 	tid = (uintptr_t)curthread;
 
-	if (SCHEDULER_STOPPED())
+	if (SCHEDULER_STOPPED()) {
+		/*
+		 * Ensure that spinlock sections are balanced even when the
+		 * scheduler is stopped, since we may otherwise inadvertently
+		 * re-enable interrupts while dumping core.
+		 */
+		spinlock_enter();
 		return;
+	}
 
 #ifdef KDTRACE_HOOKS
 	spin_time -= lockstat_nsecs(&td->td_lock->lock_object);


More information about the svn-src-all mailing list