Skip to content

Commit

Permalink
In r354148 the goal was to check THREAD_CAN_SLEEP() only once for the
Browse files Browse the repository at this point in the history
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
  • Loading branch information
glebius committed Sep 9, 2020
1 parent 278847a commit 022c2f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sys/kern/subr_sleepqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion sys/kern/subr_trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 022c2f5

Please sign in to comment.