diff options
author | jhb <jhb@FreeBSD.org> | 2001-11-15 19:46:36 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-11-15 19:46:36 +0000 |
commit | 7225db9bf4bec1e98eb06c0f6f1cc3228e377068 (patch) | |
tree | d0d201898c5c71e88792fc72d8831909e87a9cc0 /sys/kern | |
parent | db445b8143fc8215c12408e4d0fbfc909d2fe0ee (diff) | |
download | FreeBSD-src-7225db9bf4bec1e98eb06c0f6f1cc3228e377068.zip FreeBSD-src-7225db9bf4bec1e98eb06c0f6f1cc3228e377068.tar.gz |
Add a couple of returns to making recovering from a failed witness_assert()
more sane in the RESTARTABLE_PANICS case.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_witness.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index a9b1864..b91f7a2 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -1419,9 +1419,11 @@ witness_assert(struct lock_object *lock, int flags, const char *file, int line) instance = find_instance(curthread->td_sleeplocks, lock); else if ((lock->lo_class->lc_flags & LC_SPINLOCK) != 0) instance = find_instance(PCPU_GET(spinlocks), lock); - else + else { panic("Lock (%s) %s is not sleep or spin!", lock->lo_class->lc_name, lock->lo_name); + return; + } switch (flags) { case LA_UNLOCKED: if (instance != NULL) @@ -1437,9 +1439,11 @@ witness_assert(struct lock_object *lock, int flags, const char *file, int line) case LA_XLOCKED: case LA_XLOCKED | LA_RECURSED: case LA_XLOCKED | LA_NOTRECURSED: - if (instance == NULL) + if (instance == NULL) { panic("Lock (%s) %s not locked @ %s:%d.", lock->lo_class->lc_name, lock->lo_name, file, line); + break; + } if ((flags & LA_XLOCKED) != 0 && (instance->li_flags & LI_EXCLUSIVE) == 0) panic("Lock (%s) %s not exclusively locked @ %s:%d.", |