Skip to content

Commit 7a27472

Browse files
isilenceaxboe
authored andcommitted
io_uring: don't modify req->poll for rw
__io_queue_proc() is used by both poll and apoll, so we should not access req->poll directly but selecting right struct io_poll_iocb depending on use case. Reported-and-tested-by: [email protected] Fixes: ea6a693 ("io_uring: disable multishot poll for double poll add cases") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/4a6a1de31142d8e0250fe2dfd4c8923d82a5bbfc.1621251795.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 489809e commit 7a27472

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/io_uring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5019,10 +5019,10 @@ static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt,
50195019
* Can't handle multishot for double wait for now, turn it
50205020
* into one-shot mode.
50215021
*/
5022-
if (!(req->poll.events & EPOLLONESHOT))
5023-
req->poll.events |= EPOLLONESHOT;
5022+
if (!(poll_one->events & EPOLLONESHOT))
5023+
poll_one->events |= EPOLLONESHOT;
50245024
/* double add on the same waitqueue head, ignore */
5025-
if (poll->head == head)
5025+
if (poll_one->head == head)
50265026
return;
50275027
poll = kmalloc(sizeof(*poll), GFP_ATOMIC);
50285028
if (!poll) {

0 commit comments

Comments
 (0)