summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-07-16 12:27:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-07-16 12:27:33 -0700
commit13fdaf041067a7827b8c3cae095b661aabbc6b65 (patch)
treec18cad843c5a2d9cb08fd17128e241b90690fe52 /fs
parent45312bd762d37bfc7dda6de8a70bb5604e899015 (diff)
parent1b48773f9fd09f311d1166ce1dd50652ebe05218 (diff)
downloadlinux-13fdaf041067a7827b8c3cae095b661aabbc6b65.tar.bz2
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
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d94fb5835a20..0cac361bf6b8 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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);
@@ -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;
}