From 022c2f5570f14c24186847d93298c0c17fac5e9b Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 9 Sep 2020 16:13:33 +0000 Subject: [PATCH] In r354148 the goal was to check THREAD_CAN_SLEEP() only once for the purpose of epoch_trace() and for calling subsequent panic, but to keep code fully under INVARIANTS, so don't use bare function call to panic(). However, at the last stage of review a true value slipped in, while always false was assumed. I checked that in email archive with kib@. Noticed by: trasz --- sys/kern/subr_sleepqueue.c | 2 +- sys/kern/subr_trap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 56515f033f5d..c81e62c723e6 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -325,7 +325,7 @@ sleepq_add(const void *wchan, struct lock_object *lock, const char *wmesg, #ifdef EPOCH_TRACE epoch_trace_list(curthread); #endif - KASSERT(1, + KASSERT(0, ("%s: td %p to sleep on wchan %p with sleeping prohibited", __func__, td, wchan)); } diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 08d8d2cb2239..145ed0262ad8 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -187,7 +187,7 @@ userret(struct thread *td, struct trapframe *frame) #ifdef EPOCH_TRACE epoch_trace_list(curthread); #endif - KASSERT(1, ("userret: Returning with sleep disabled")); + KASSERT(0, ("userret: Returning with sleep disabled")); } KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, ("userret: Returning with with pinned thread"));