summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKeith Busch2014-06-06 18:22:07 +0200
committerJens Axboe2014-06-06 18:40:03 +0200
commit3b632cf0eaa2e89a12c18f043e6e7c5bcc003645 (patch)
tree91311650aee107995e71b98cdb53f47fe3e8b1dd /block
parentblk-mq: bump max tag depth to 10K tags (diff)
downloadkernel-qcow2-linux-3b632cf0eaa2e89a12c18f043e6e7c5bcc003645.tar.gz
kernel-qcow2-linux-3b632cf0eaa2e89a12c18f043e6e7c5bcc003645.tar.xz
kernel-qcow2-linux-3b632cf0eaa2e89a12c18f043e6e7c5bcc003645.zip
blk-mq: don't allow queue entering for a dying queue
If the queue is going away, don't let new allocs or queueing happen on it. Go through the normal wait process, and exit with ENODEV in that case. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index a6ee74e27957..75fc33f34251 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -82,8 +82,10 @@ static int blk_mq_queue_enter(struct request_queue *q)
__percpu_counter_add(&q->mq_usage_counter, 1, 1000000);
smp_wmb();
- /* we have problems to freeze the queue if it's initializing */
- if (!blk_queue_bypass(q) || !blk_queue_init_done(q))
+
+ /* we have problems freezing the queue if it's initializing */
+ if (!blk_queue_dying(q) &&
+ (!blk_queue_bypass(q) || !blk_queue_init_done(q)))
return 0;
__percpu_counter_add(&q->mq_usage_counter, -1, 1000000);