Skip to content

Commit

Permalink
io_uring: use original request task for inflight tracking
Browse files Browse the repository at this point in the history
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: 9cae36a ("io_uring: reinstate the inflight tracking")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jun 23, 2022
1 parent e70b64a commit 386e4fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,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);
}
}

Expand Down

0 comments on commit 386e4fb

Please sign in to comment.