Commit 9a91b05b authored by Hou Tao's avatar Hou Tao Committed by Jens Axboe
Browse files

block: also check RQF_STATS in blk_mq_need_time_stamp()



In __blk_mq_end_request() if block stats needs update, we should
ensure now is valid instead of 0 even when iostat is disabled.

Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3d244306
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -282,12 +282,12 @@ bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx)
EXPORT_SYMBOL(blk_mq_can_queue);

/*
 * Only need start/end time stamping if we have stats enabled, or using
 * an IO scheduler.
 * Only need start/end time stamping if we have iostat or
 * blk stats enabled, or using an IO scheduler.
 */
static inline bool blk_mq_need_time_stamp(struct request *rq)
{
	return (rq->rq_flags & RQF_IO_STAT) || rq->q->elevator;
	return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS)) || rq->q->elevator;
}

static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,