Skip to content

Commit

Permalink
ktls: fix a panic with INVARIANTS
Browse files Browse the repository at this point in the history
9821500 introduced a new
thread that uses tsleep(..0) to sleep forever.  This hit
an assert due to sleeping with a 0 timeout.

So spell "forever" using SBT_MAX instead, which does not
trigger the assert.

Pointy hat to: gallatin
Pointed out by: emaste
Sponsored by: Netflix
  • Loading branch information
Andrew Gallatin authored and Andrew Gallatin committed Aug 5, 2021
1 parent 4cc6fe1 commit 2694c86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/kern/uipc_ktls.c
Expand Up @@ -2240,7 +2240,7 @@ ktls_alloc_thread(void *ctx)
nbufs = 0;
for (;;) {
atomic_store_int(&sc->running, 0);
tsleep(sc, PZERO, "waiting for work", 0);
tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, SBT_1S, 0);
atomic_store_int(&sc->running, 1);
sc->wakeups++;
if (nbufs != ktls_max_alloc) {
Expand Down

0 comments on commit 2694c86

Please sign in to comment.