From: Jens Axboe Date: Tue, 6 Dec 2016 15:26:42 +0000 (-0700) Subject: blk-mq: fix completion byte stats with scheduling X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=refs%2Fheads%2Fblk-mq-legacy-sched;p=linux-2.6-block.git blk-mq: fix completion byte stats with scheduling Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index cc1c70330962..d9c3c6622ca5 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -877,6 +877,8 @@ static void sched_rq_end_io(struct request *rq, int error) /* transfer queue ref to 'rq', blk_mq_free_request() drops it */ sched_rq->rq_flags &= ~RQF_HAS_Q_REF; + blk_account_io_completion(sched_rq, blk_rq_bytes(sched_rq)); + spin_lock_irqsave(q->queue_lock, flags); blk_finish_request(sched_rq, error); spin_unlock_irqrestore(q->queue_lock, flags);