Skip to content

Commit b9231df

Browse files
committed
Merge tag 'io_uring-5.13-2021-05-22' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe: "One fix for a regression with poll in this merge window, and another just hardens the io-wq exit path a bit" * tag 'io_uring-5.13-2021-05-22' of git://git.kernel.dk/linux-block: io_uring: fortify tctx/io_wq cleanup io_uring: don't modify req->poll for rw
2 parents 23d7292 + ba5ef6d commit b9231df

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/io_uring.c

Lines changed: 7 additions & 7 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) {
@@ -9035,15 +9035,15 @@ static void io_uring_del_task_file(unsigned long index)
90359035

90369036
static void io_uring_clean_tctx(struct io_uring_task *tctx)
90379037
{
9038+
struct io_wq *wq = tctx->io_wq;
90389039
struct io_tctx_node *node;
90399040
unsigned long index;
90409041

9042+
tctx->io_wq = NULL;
90419043
xa_for_each(&tctx->xa, index, node)
90429044
io_uring_del_task_file(index);
9043-
if (tctx->io_wq) {
9044-
io_wq_put_and_exit(tctx->io_wq);
9045-
tctx->io_wq = NULL;
9046-
}
9045+
if (wq)
9046+
io_wq_put_and_exit(wq);
90479047
}
90489048

90499049
static s64 tctx_inflight(struct io_uring_task *tctx, bool tracked)

0 commit comments

Comments
 (0)