On 2020-02-09 18:13, yukuai (C) wrote: > I tested following patch fixes the problem, however I'm not sure if > move blk_trace_shutdown() and blk_mu_exit_queue() is ok or we should > just move debgfs-related part. >From blk-mq.c: /* tags can _not_ be used after returning from blk_mq_exit_queue */ void blk_mq_exit_queue(struct request_queue *q) { struct blk_mq_tag_set *set = q->tag_set; blk_mq_del_queue_tag_set(q); blk_mq_exit_hw_queues(q, set, set->nr_hw_queues); } I think that calling blk_mq_exit_queue() from blk_unregister_queue() would break at least the sd driver. The sd driver can issue I/O after having called del_gendisk(). See also the sd_sync_cache() call in sd_shutdown(). Bart.