On Fri, 2022-04-15 at 11:56 +0800, Yu Kuai wrote: > 'q->debugfs_dir' is created in blk_register_queue(), however, it's not > removed in blk_unregister_queue() and is delayed to blk_release_queue(). > Thus it's possible that del_gendisk() is done and blk_release_queue() > is not called yet, and in the mean time blk_register_queue() is called > for the new device with the same name. In this case, kernel will > compalin about creation failure for 'debugfs_dir' like following: > > debugfs: Directory 'nullb1' with parent 'block' already present! > > Fix the problem by moving forward the removal of 'debgfs_dir' to > blk_unregister_queue(). > > Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx> Looks like I'm late to the party, but for what its worth: Tested-by: Dan Williams <dan.j.williams@xxxxxxxxx> Thanks!