summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-09-27 15:45:54 +0000
committerkib <kib@FreeBSD.org>2008-09-27 15:45:54 +0000
commit1fb31bd1679881409fff32bda5a1201ecf8d56e9 (patch)
treead38de66a196f964e2ab8090f18db54fc15a6219 /sys/kern/kern_shutdown.c
parente873cabccd956a8738db1ee6d04dc32c1614c9e3 (diff)
downloadFreeBSD-src-1fb31bd1679881409fff32bda5a1201ecf8d56e9.zip
FreeBSD-src-1fb31bd1679881409fff32bda5a1201ecf8d56e9.tar.gz
If the panic thread is preempted after setting panicstr but before
setting TDF_INPANIC then it will never be rescheduled again. Wrap setting the panic condition with the critical section. Noted and reviewed by: tegge MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 6c3d82d..e6d4f44 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -511,6 +511,7 @@ panic(const char *fmt, ...)
va_list ap;
static char buf[256];
+ critical_enter();
#ifdef SMP
/*
* We don't want multiple CPU's to panic at the same time, so we
@@ -569,6 +570,7 @@ panic(const char *fmt, ...)
/* thread_unlock(td); */
if (!sync_on_panic)
bootopt |= RB_NOSYNC;
+ critical_exit();
boot(bootopt);
}
OpenPOWER on IntegriCloud