From: Bart Van Assche Date: Wed, 23 Aug 2017 17:56:29 +0000 (-0700) Subject: block: Warn if blk_queue_rq_timed_out() is called for a blk-mq queue X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=130d733a616372ba5d375f9ca8da9378924b6889;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git block: Warn if blk_queue_rq_timed_out() is called for a blk-mq queue The timeout handler set by blk_queue_rq_timed_out() is only used in single queue mode. Calling this function for blk-mq drivers is wrong. Hence issue a warning if this function is called by a blk-mq driver. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Signed-off-by: Jens Axboe --- diff --git a/block/blk-settings.c b/block/blk-settings.c index be1f115b538b..8559e9563c52 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -68,6 +68,7 @@ EXPORT_SYMBOL_GPL(blk_queue_rq_timeout); void blk_queue_rq_timed_out(struct request_queue *q, rq_timed_out_fn *fn) { + WARN_ON_ONCE(q->mq_ops); q->rq_timed_out_fn = fn; } EXPORT_SYMBOL_GPL(blk_queue_rq_timed_out);