kqueue: avoid a possible fork-deadlock

kqueue_fork_copy() is likely to have transitioned at least one knote
through a flux state, so we should check whether we need to wake
anything up on the way out to avoid a possible deadlock.

This was a part of D56210, but we'll close the review with the next
commit.

Fixes:	b11289f871 ("kqueuex(2): add KQUEUE_CPONFORK")
Reviewed by:	kib, markj
This commit is contained in:
Kyle Evans
2026-04-01 17:30:48 -05:00
parent 0b4f0e0515
commit 14d0baf2e8
+1 -1
View File
@@ -3147,7 +3147,7 @@ kqueue_fork_copy(struct filedesc *fdp, struct file *fp, struct file *fp1,
}
kqueue_release(kq, 1);
kq1->kq_forksrc = NULL;
KQ_UNLOCK(kq);
KQ_UNLOCK_FLUX(kq);
knote_free(marker);
return (error);