assert that td_lk_slocks is not leaked upon return from kernel

This is similar to checks for td_sx_slocks and td_rw_rlocks.
Although td_lk_slocks is an implementation detail, it still makes sense
to validate it.

MFC after:	1 week
Sponsored by:	Panzura
This commit is contained in:
avg 2019-08-19 11:18:36 +00:00
parent 20a19e32a4
commit 6261923e4c

View File

@ -176,6 +176,9 @@ userret(struct thread *td, struct trapframe *frame)
KASSERT(td->td_sx_slocks == 0,
("userret: Returning with %d sx locks held in shared mode",
td->td_sx_slocks));
KASSERT(td->td_lk_slocks == 0,
("userret: Returning with %d lockmanager locks held in shared mode",
td->td_lk_slocks));
KASSERT((td->td_pflags & TDP_NOFAULTING) == 0,
("userret: Returning with pagefaults disabled"));
KASSERT(td->td_no_sleeping == 0,