]> git.baikalelectronics.ru Git - kernel.git/commitdiff
io_uring: use original request task for inflight tracking
authorJens Axboe <axboe@kernel.dk>
Thu, 23 Jun 2022 17:06:43 +0000 (11:06 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 23 Jun 2022 17:06:43 +0000 (11:06 -0600)
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: 7d6e647a466a ("io_uring: reinstate the inflight tracking")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 5c95755619e2dc317f80a746c9952fad538735b7..5ff2cdb425bc4c4c3c71e221ee771e99d9ba5702 100644 (file)
@@ -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);
        }
 }