io_uring: fix NULL mm in io_poll_task_func()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 30 Jun 2020 12:20:41 +0000 (15:20 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 30 Jun 2020 15:32:04 +0000 (09:32 -0600)
io_poll_task_func() hand-coded link submission forgetting to set
TASK_RUNNING, acquire mm, etc. Call existing helper for that,
i.e. __io_req_task_submit().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 43419f5bef8cd74f2f96d9a7d54ee1c8ccfaa158..2c17c2613205b73217eb5f40893a4d57d8a0b900 100644 (file)
@@ -4518,13 +4518,8 @@ static void io_poll_task_func(struct callback_head *cb)
        struct io_kiocb *nxt = NULL;
 
        io_poll_task_handler(req, &nxt);
-       if (nxt) {
-               struct io_ring_ctx *ctx = nxt->ctx;
-
-               mutex_lock(&ctx->uring_lock);
-               __io_queue_sqe(nxt, NULL, NULL);
-               mutex_unlock(&ctx->uring_lock);
-       }
+       if (nxt)
+               __io_req_task_submit(nxt);
 }
 
 static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,