Skip to content

Commit aee1a00

Browse files
committed
Merge tag 'io_uring-5.7-2020-04-24' of git://git.kernel.dk/linux-block
Pull io_uring fix from Jens Axboe: "Single fixup for a change that went into -rc2" * tag 'io_uring-5.7-2020-04-24' of git://git.kernel.dk/linux-block: io_uring: only restore req->work for req that needs do completion
2 parents 81da3d3 + 44575a6 commit aee1a00

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/io_uring.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,17 +4200,17 @@ static void io_async_task_func(struct callback_head *cb)
42004200

42014201
spin_unlock_irq(&ctx->completion_lock);
42024202

4203+
/* restore ->work in case we need to retry again */
4204+
memcpy(&req->work, &apoll->work, sizeof(req->work));
4205+
42034206
if (canceled) {
42044207
kfree(apoll);
42054208
io_cqring_ev_posted(ctx);
42064209
req_set_fail_links(req);
4207-
io_put_req(req);
4210+
io_double_put_req(req);
42084211
return;
42094212
}
42104213

4211-
/* restore ->work in case we need to retry again */
4212-
memcpy(&req->work, &apoll->work, sizeof(req->work));
4213-
42144214
__set_current_state(TASK_RUNNING);
42154215
mutex_lock(&ctx->uring_lock);
42164216
__io_queue_sqe(req, NULL);
@@ -4369,7 +4369,7 @@ static bool io_poll_remove_one(struct io_kiocb *req)
43694369

43704370
hash_del(&req->hash_node);
43714371

4372-
if (apoll) {
4372+
if (do_complete && apoll) {
43734373
/*
43744374
* restore ->work because we need to call io_req_work_drop_env.
43754375
*/

0 commit comments

Comments
 (0)