block: Warn if blk_queue_rq_timed_out() is called for a blk-mq queue
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 23 Aug 2017 17:56:29 +0000 (10:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Aug 2017 18:02:30 +0000 (12:02 -0600)
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 <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c

index be1f115b538b3f874a8db5fd4eef000621821ad6..8559e9563c5255f114309e95a9d09b71550d0af2 100644 (file)
@@ -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);