summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-06-23 11:06:43 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-25 15:29:48 +0200
commit54097f1eef441b6c6171b96b04e3562d2cd75a14 (patch)
tree8df5fb35e2e162c22dfd772dc6778046e72bb8db
parentfbd4abed8ff6d112f849770a13efd84ca83102f6 (diff)
io_uring: use original request task for inflight tracking
commit 386e4fb6962b9f248a80f8870aea0870ca603e89 upstream. In prior kernels, we did file assignment always at prep time. This meant that req->task == current. But after deferring that assignment and then pushing the inflight tracking back in, we've got the inflight tracking using current when it should in fact now be using req->task. Fixup that error introduced by adding the inflight tracking back after file assignments got modifed. Fixes: 9cae36a094e7 ("io_uring: reinstate the inflight tracking") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3d123ca028c9..68aab48838e4 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1647,7 +1647,7 @@ static inline void io_req_track_inflight(struct io_kiocb *req)
{
if (!(req->flags & REQ_F_INFLIGHT)) {
req->flags |= REQ_F_INFLIGHT;
- atomic_inc(&current->io_uring->inflight_tracked);
+ atomic_inc(&req->task->io_uring->inflight_tracked);
}
}