Skip to content

Commit

Permalink
Merge tag 'io_uring-5.14-2021-07-16' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Jul 16, 2021
2 parents 45312bd + 1b48773 commit 13fdaf0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ static void io_req_task_submit(struct io_kiocb *req)

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

ret = io_req_prep_async(req);
if (ret)
return ret;
goto fail;
io_prep_async_link(req);
de = kmalloc(sizeof(*de), GFP_KERNEL);
if (!de) {
io_req_complete_failed(req, -ENOMEM);
ret = -ENOMEM;
fail:
io_req_complete_failed(req, ret);
return true;
}

Expand Down

0 comments on commit 13fdaf0

Please sign in to comment.