summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2017-08-23 10:56:29 -0700
committerJens Axboe <axboe@kernel.dk>2017-08-23 12:02:30 -0600
commit130d733a616372ba5d375f9ca8da9378924b6889 (patch)
tree55af1bd8860198819d8654e0ae8e2629da627565 /block
parent2f54a613c9421ddd5897f861145ed0b8615a2ec4 (diff)
downloadlinux-130d733a616372ba5d375f9ca8da9378924b6889.tar.gz
linux-130d733a616372ba5d375f9ca8da9378924b6889.tar.bz2
linux-130d733a616372ba5d375f9ca8da9378924b6889.zip
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 <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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-settings.c1
1 files changed, 1 insertions, 0 deletions
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);