On Apr 21, 2022 / 16:34, Ming Lei wrote: > q->debugfs_dir is used by blk-mq debugfs and blktrace. The dentry is > created when adding disk, and removed when releasing request queue. > > There is small window between releasing disk and releasing request > queue, and during the period, one disk with same name may be created > and added, so debugfs_create_dir() may complain with "Directory XXXXX > with parent 'block' already present!" > > Fixes the issue by moving debugfs_create_dir() into blk_alloc_queue(), > and the dir name is named with q->id from beginning, and switched to > disk name when adding disk, and finally changed to q->id in disk_release(). > > Reported-by: Dan Williams <dan.j.williams@xxxxxxxxx> > Cc: yukuai (C) <yukuai3@xxxxxxxxxx> > Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> Thank you Ming, I confirmed that blktests block group all passes with this patch, including the block/002 test case. Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> -- Best Regards, Shin'ichiro Kawasaki