Commit 13fdaf04 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'io_uring-5.14-2021-07-16' of git://

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://
  io_uring: fix io_drain_req()
  io_uring: use right task for exiting checks
parents 45312bd7 1b48773f
...@@ -2016,7 +2016,7 @@ static void io_req_task_submit(struct io_kiocb *req) ...@@ -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 */ /* ctx stays valid until unlock, even if we drop all ours ctx->refs */
mutex_lock(&ctx->uring_lock); 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); __io_queue_sqe(req);
else else
io_req_complete_failed(req, -EFAULT); io_req_complete_failed(req, -EFAULT);
...@@ -6019,11 +6019,13 @@ static bool io_drain_req(struct io_kiocb *req) ...@@ -6019,11 +6019,13 @@ static bool io_drain_req(struct io_kiocb *req)
ret = io_req_prep_async(req); ret = io_req_prep_async(req);
if (ret) if (ret)
return ret; goto fail;
io_prep_async_link(req); io_prep_async_link(req);
de = kmalloc(sizeof(*de), GFP_KERNEL); de = kmalloc(sizeof(*de), GFP_KERNEL);
if (!de) { if (!de) {
io_req_complete_failed(req, -ENOMEM); ret = -ENOMEM;
io_req_complete_failed(req, ret);
return true; return true;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment