On Tue, Jul 07, 2020 at 04:45:52PM +0800, Ming Lei wrote: > After clearing fd or changing fd, we have to delete old partitions, > otherwise they may become ghost partitions. > > Fix this issue by clearing GENHD_FL_NO_PART_SCAN during calling > bdev_disk_changed() which won't drop old partitions if GENHD_FL_NO_PART_SCAN > isn't set. I don't think messing with GENHD_FL_NO_PART_SCAN is a good idea, as that will also cause an actual partition scan. But except for historic reasons I can't think of a good idea to even check for GENHD_FL_NO_PART_SCAN in blk_drop_partitions.