FreeBSD Bugzilla – Attachment 188967 Details for
Bug 203366
kevent: EV_CLEAR on fifo does not work correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
wake up pipe writers in edge triggered way
edge-triggered-pipe-writer-wakeup.patch (text/plain), 912 bytes, created by
Jan Kokemüller
on 2017-12-19 16:43:46 UTC
(
hide
)
Description:
wake up pipe writers in edge triggered way
Filename:
MIME Type:
Creator:
Jan Kokemüller
Created:
2017-12-19 16:43:46 UTC
Size:
912 bytes
patch
obsolete
>diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c >index 649f371d3610..fc57eeac96b3 100644 >--- a/sys/kern/sys_pipe.c >+++ b/sys/kern/sys_pipe.c >@@ -821,7 +821,20 @@ unlocked_error: > } > } > >- if ((rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt) >= PIPE_BUF) >+ /* >+ * Only wake up writers if there was actually something read. >+ * Otherwise, when calling read(2) at EOF, pipeselwakeup would >+ * re-trigger EVFILT_READ/EV_EOF notifications that might have just >+ * been cleared with EV_CLEAR, resulting in an infinite loop (see PR >+ * 203366): >+ * >+ * kevent(4,...,{ 3,EVFILT_READ,EV_CLEAR|EV_EOF,...},1,0x0) = 1 (0x1) >+ * read(3,...,4096) = 0 (0x0) >+ * kevent(4,...,{ 3,EVFILT_READ,EV_CLEAR|EV_EOF,...},1,0x0) = 1 (0x1) >+ * ... >+ */ >+ if (nread > 0 && >+ (rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt) >= PIPE_BUF) > pipeselwakeup(rpipe); > > PIPE_UNLOCK(rpipe);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203366
:
162301
|
167574
|
188967
|
190730