io_uring: use original request task for inflight tracking

commit 386e4fb696 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: 9cae36a094 ("io_uring: reinstate the inflight tracking")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jens Axboe 2022-06-23 11:06:43 -06:00 коммит произвёл Greg Kroah-Hartman
Родитель 374bf3fc1f
Коммит 3746d62ecf
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1405,7 +1405,7 @@ static 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);
}
}