git: 14d0baf2e892 - main - kqueue: avoid a possible fork-deadlock
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 01 Apr 2026 22:33:30 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=14d0baf2e89202cec3f9cb03a573372ccbc568b2
commit 14d0baf2e89202cec3f9cb03a573372ccbc568b2
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2026-04-01 22:30:48 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-04-01 22:30:48 +0000
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: b11289f87123f ("kqueuex(2): add KQUEUE_CPONFORK")
Reviewed by: kib, markj
---
sys/kern/kern_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 2cdc37b710e6..6af53cf6cd91 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -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);