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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user