blk-mq: cancel blk-mq dispatch work in both blk_cleanup_queue and disk_release()
[platform/kernel/linux-starfive.git] / block / blk-core.c
index 9ee32f8..f0f38ca 100644 (file)
@@ -363,8 +363,10 @@ void blk_cleanup_queue(struct request_queue *q)
        blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
 
        blk_sync_queue(q);
-       if (queue_is_mq(q))
+       if (queue_is_mq(q)) {
+               blk_mq_cancel_work_sync(q);
                blk_mq_exit_queue(q);
+       }
 
        /*
         * In theory, request pool of sched_tags belongs to request queue.