Skip to content

Commit 13fdaf0

Browse files
committed
Merge tag 'io_uring-5.14-2021-07-16' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe: "Two small fixes: one fixing the process target of a check, and the other a minor issue with the drain error handling" * tag 'io_uring-5.14-2021-07-16' of git://git.kernel.dk/linux-block: io_uring: fix io_drain_req() io_uring: use right task for exiting checks
2 parents 45312bd + 1b48773 commit 13fdaf0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/io_uring.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ static void io_req_task_submit(struct io_kiocb *req)
20162016

20172017
/* ctx stays valid until unlock, even if we drop all ours ctx->refs */
20182018
mutex_lock(&ctx->uring_lock);
2019-
if (!(current->flags & PF_EXITING) && !current->in_execve)
2019+
if (!(req->task->flags & PF_EXITING) && !req->task->in_execve)
20202020
__io_queue_sqe(req);
20212021
else
20222022
io_req_complete_failed(req, -EFAULT);
@@ -6019,11 +6019,13 @@ static bool io_drain_req(struct io_kiocb *req)
60196019

60206020
ret = io_req_prep_async(req);
60216021
if (ret)
6022-
return ret;
6022+
goto fail;
60236023
io_prep_async_link(req);
60246024
de = kmalloc(sizeof(*de), GFP_KERNEL);
60256025
if (!de) {
6026-
io_req_complete_failed(req, -ENOMEM);
6026+
ret = -ENOMEM;
6027+
fail:
6028+
io_req_complete_failed(req, ret);
60276029
return true;
60286030
}
60296031

0 commit comments

Comments
 (0)