diff options
-rw-r--r-- | block/blk-core.c | 3 | ||||
-rw-r--r-- | block/blk-sysfs.c | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 0421b53e6431..93f9152fc271 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -525,6 +525,9 @@ void blk_cleanup_queue(struct request_queue *q) | |||
525 | del_timer_sync(&q->backing_dev_info.laptop_mode_wb_timer); | 525 | del_timer_sync(&q->backing_dev_info.laptop_mode_wb_timer); |
526 | blk_sync_queue(q); | 526 | blk_sync_queue(q); |
527 | 527 | ||
528 | if (q->mq_ops) | ||
529 | blk_mq_free_queue(q); | ||
530 | |||
528 | spin_lock_irq(lock); | 531 | spin_lock_irq(lock); |
529 | if (q->queue_lock != &q->__queue_lock) | 532 | if (q->queue_lock != &q->__queue_lock) |
530 | q->queue_lock = &q->__queue_lock; | 533 | q->queue_lock = &q->__queue_lock; |
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 1fac43408911..935ea2aa0730 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
@@ -492,17 +492,15 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head) | |||
492 | * Currently, its primary task it to free all the &struct request | 492 | * Currently, its primary task it to free all the &struct request |
493 | * structures that were allocated to the queue and the queue itself. | 493 | * structures that were allocated to the queue and the queue itself. |
494 | * | 494 | * |
495 | * Caveat: | 495 | * Note: |
496 | * Hopefully the low level driver will have finished any | 496 | * The low level driver must have finished any outstanding requests first |
497 | * outstanding requests first... | 497 | * via blk_cleanup_queue(). |
498 | **/ | 498 | **/ |
499 | static void blk_release_queue(struct kobject *kobj) | 499 | static void blk_release_queue(struct kobject *kobj) |
500 | { | 500 | { |
501 | struct request_queue *q = | 501 | struct request_queue *q = |
502 | container_of(kobj, struct request_queue, kobj); | 502 | container_of(kobj, struct request_queue, kobj); |
503 | 503 | ||
504 | blk_sync_queue(q); | ||
505 | |||
506 | blkcg_exit_queue(q); | 504 | blkcg_exit_queue(q); |
507 | 505 | ||
508 | if (q->elevator) { | 506 | if (q->elevator) { |
@@ -517,9 +515,7 @@ static void blk_release_queue(struct kobject *kobj) | |||
517 | if (q->queue_tags) | 515 | if (q->queue_tags) |
518 | __blk_queue_free_tags(q); | 516 | __blk_queue_free_tags(q); |
519 | 517 | ||
520 | if (q->mq_ops) | 518 | if (!q->mq_ops) |
521 | blk_mq_free_queue(q); | ||
522 | else | ||
523 | blk_free_flush_queue(q->fq); | 519 | blk_free_flush_queue(q->fq); |
524 | 520 | ||
525 | blk_trace_shutdown(q); | 521 | blk_trace_shutdown(q); |