On Fri 10-02-23 09:58:36, Yu Kuai wrote: > Hi, > > 在 2023/02/09 21:58, Jan Kara 写道: > > > Sorry, I'm not sure what your are asking about here :) Can you please > > elaborate more? > > > It's another artificail race that will cause part scan fail in > device_add_disk(). > > bdev_add() -> user can open the device now > > disk_scan_partitions -> will fail is the device is already opened > exclusively > > I'm thinking about set disk state before bdev_add()... Oh, right. Yes, that should be a good fix to set GD_NEED_PART_SCAN before calling bdev_add(). Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR