Skip to content

Commit 07feac8

Browse files
dwsusegregkh
authored andcommitted
block: Suppress uevent for hidden device when removed
[ Upstream commit 9ec4914 ] register_disk() suppress uevents for devices with the GENHD_FL_HIDDEN but enables uevents at the end again in order to announce disk after possible partitions are created. When the device is removed the uevents are still on and user land sees 'remove' messages for devices which were never 'add'ed to the system. KERNEL[95481.571887] remove /devices/virtual/nvme-fabrics/ctl/nvme5/nvme0c5n1 (block) Let's suppress the uevents for GENHD_FL_HIDDEN by not enabling the uevents at all. Signed-off-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin Wilck <mwilck@suse.com> Link: https://lore.kernel.org/r/20210311151917.136091-1-dwagner@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9f70460 commit 07feac8

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎block/genhd.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,8 @@ static void register_disk(struct device *parent, struct gendisk *disk,
732732
disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
733733
disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
734734

735-
if (disk->flags & GENHD_FL_HIDDEN) {
736-
dev_set_uevent_suppress(ddev, 0);
735+
if (disk->flags & GENHD_FL_HIDDEN)
737736
return;
738-
}
739737

740738
disk_scan_partitions(disk);
741739

0 commit comments

Comments
 (0)