On Mon, Apr 14, 2025 at 08:19:10AM +0200, Christoph Hellwig wrote: > On Thu, Apr 10, 2025 at 09:30:19PM +0800, Ming Lei wrote: > > Move blk_unregister_queue() & device_del() after freeze wait, and prepare > > for unifying elevator switch. > > > > This way is just fine, since bdev has been unhashed at the beginning of > > del_gendisk(), both blk_unregister_queue() & device_del() are dealing > > with kobject & debugfs thing only. > > While I believe this is the right thing to do, moving the freeze wait > caused issues in the past, so be careful. Take a look at: > > commit 4c66a326b5ab784cddd72de07ac5b6210e9e1b06 > Author: Christoph Hellwig <hch@xxxxxx> > Date: Mon Sep 19 16:40:49 2022 +0200 > > Revert "block: freeze the queue earlier in del_gendisk" Yeah, I know this story. If it is triggered again with this patch, I will help to root cause. The last thing we still can do is to just moving blk_unregister_queue() after queue is frozen, or even elevator tear down. It is allowed to delete children kobjects after their parent is removed. Just the KOBJ_REMOVE event need to be ordered. Thanks, Ming