summaryrefslogtreecommitdiff
path: root/sys/kern/kern_rwlock.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-03-21 12:28:40 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-03-21 12:28:40 +0000
commit99d953cd46883d534b86f278634e527687b8d7d3 (patch)
treec4fe3d21ada7e57f614f0d10173a3ba17289e29e /sys/kern/kern_rwlock.c
parent08e0d9951ab1b77c834540c649f5511ed40f34a3 (diff)
Disable the rw lock assertion after panic. Allows reboot from ddb.
OK mpi@ visa@
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r--sys/kern/kern_rwlock.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index 1bde7064757..d24bb6c8734 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_rwlock.c,v 1.34 2018/03/20 15:45:32 mpi Exp $ */
+/* $OpenBSD: kern_rwlock.c,v 1.35 2018/03/21 12:28:39 bluhm Exp $ */
/*
* Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org>
@@ -333,6 +333,9 @@ rw_status(struct rwlock *rwl)
void
rw_assert_wrlock(struct rwlock *rwl)
{
+ if (panicstr || db_active)
+ return;
+
if (!(rwl->rwl_owner & RWLOCK_WRLOCK))
panic("%s: lock not held", rwl->rwl_name);
@@ -343,6 +346,9 @@ rw_assert_wrlock(struct rwlock *rwl)
void
rw_assert_rdlock(struct rwlock *rwl)
{
+ if (panicstr || db_active)
+ return;
+
if (!RWLOCK_OWNER(rwl) || (rwl->rwl_owner & RWLOCK_WRLOCK))
panic("%s: lock not shared", rwl->rwl_name);
}
@@ -350,6 +356,9 @@ rw_assert_rdlock(struct rwlock *rwl)
void
rw_assert_anylock(struct rwlock *rwl)
{
+ if (panicstr || db_active)
+ return;
+
switch (rw_status(rwl)) {
case RW_WRITE_OTHER:
panic("%s: lock held by different process", rwl->rwl_name);
@@ -361,6 +370,9 @@ rw_assert_anylock(struct rwlock *rwl)
void
rw_assert_unlocked(struct rwlock *rwl)
{
+ if (panicstr || db_active)
+ return;
+
if (rwl->rwl_owner != 0L)
panic("%s: lock held", rwl->rwl_name);
}