diff --git a/block/blk-core.c b/block/blk-core.c index 074ae9376189b346e0eef9487eef6863a5a348d8..ea33d6abdcfc9e8543df0c9c5c5f735b3c4c2f9e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -784,6 +784,9 @@ void blk_cleanup_queue(struct request_queue *q) * prevent that q->request_fn() gets invoked after draining finished. */ blk_freeze_queue(q); + + rq_qos_exit(q); + spin_lock_irq(lock); queue_flag_set(QUEUE_FLAG_DEAD, q); spin_unlock_irq(lock); diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index bab47a17b96f4b2dc786d81b4a7d4c88435b821c..8286640d4d663fe51a207421f5a4190ee2d9bfb8 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -997,8 +997,6 @@ void blk_unregister_queue(struct gendisk *disk) kobject_del(&q->kobj); blk_trace_remove_sysfs(disk_to_dev(disk)); - rq_qos_exit(q); - mutex_lock(&q->sysfs_lock); if (q->request_fn || (q->mq_ops && q->elevator)) elv_unregister_queue(q);