Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150995733
D56210.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56210.diff
View Options
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -2836,7 +2836,6 @@
struct filedesc *fdp = td->td_proc->p_fd;
struct kqueue *kq;
struct knote *kn;
- int influx;
FILEDESC_XLOCK_ASSERT(fdp);
@@ -2846,22 +2845,25 @@
*/
TAILQ_FOREACH(kq, &fdp->fd_kqlist, kq_list) {
KQ_LOCK(kq);
+ if (kq->kq_knlistsize <= fd ||
+ SLIST_EMPTY(&kq->kq_knlist[fd])) {
+ KQ_UNLOCK(kq);
+ continue;
+ }
-again:
- influx = 0;
- while (kq->kq_knlistsize > fd &&
- (kn = SLIST_FIRST(&kq->kq_knlist[fd])) != NULL) {
+ while ((kn = SLIST_FIRST(&kq->kq_knlist[fd])) != NULL) {
if (kn_in_flux(kn)) {
- /* someone else might be waiting on our knote */
- if (influx)
- wakeup(kq);
+ /*
+ * Wait for this knote to stabilize, it could be
+ * the case that it's in the process of being
+ * dropped anyways.
+ */
kq->kq_state |= KQ_FLUXWAIT;
msleep(kq, &kq->kq_lock, PSOCK, "kqflxwt", 0);
- goto again;
+ continue;
}
kn_enter_flux(kn);
KQ_UNLOCK(kq);
- influx = 1;
knote_drop(kn, td);
KQ_LOCK(kq);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 9:02 AM (6 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30738009
Default Alt Text
D56210.diff (1 KB)
Attached To
Mode
D56210: kqueue: simplify knote_fdclose() and avoid a possible fork-deadlock
Attached
Detach File
Event Timeline
Log In to Comment