HomeFreeBSD

kqueue: avoid closing a file under the knlist lock

Description

kqueue: avoid closing a file under the knlist lock

Killing a knote releases its file reference, and releasing the last one
runs the close path inline.
panic: _mtx_lock_sleep: recursed on non-recursive mutex ttymtx

Revoking a controlling tty during exit reaches this whenever a knote is
still registered on it.

Released the knlist lock around the drop and restart the walk.
The knote stays valid while the lock is released.

MFC: 1 week

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D58681

Details

Provenance
seurosAuthored on Aug 7 2026, 10:57 PM
adrianCommitted on Aug 7 2026, 10:57 PM
Reviewer
kib
Differential Revision
D58681: kqueue: avoid closing a file under the knlist lock
Parents
rGe79f6aa3e5e1: ath: return error code of HAL_STATUS type
Branches
Unknown
Tags
Unknown