On Wed, Oct 09, 2024 at 01:38:20PM +0200, Christoph Hellwig wrote: > When del_gendisk shuts down access to a gendisk, it could lead to a > deadlock with sd or, which try to submit passthrough SCSI commands from > their ->release method under open_mutex. The submission can be blocked > in blk_enter_queue while del_gendisk can't get to actually telling them > top stop and wake them up. When ->release() waits in blk_enter_queue(), the following code block mutex_lock(&disk->open_mutex); __blk_mark_disk_dead(disk); xa_for_each_start(&disk->part_tbl, idx, part, 1) drop_partition(part); mutex_unlock(&disk->open_mutex); in del_gendisk() should have been done. Then del_gendisk() should move on and finally unfreeze queue, so I still don't get the idea how the above dead lock is triggered. Thanks, Ming