diff options
author | Daniel Wagner <dwagner@suse.de> | 2021-03-11 16:19:17 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-03-11 11:48:25 -0700 |
commit | 9ec491447b90ad6a4056a9656b13f0b3a1e83043 (patch) | |
tree | 6add60cb9ca2bcb03a2580a53c0b37a4b7e4b332 /block | |
parent | a8affc03a9b375e19bc81573de0c9108317d78c7 (diff) | |
download | linux-stable-9ec491447b90ad6a4056a9656b13f0b3a1e83043.tar.gz linux-stable-9ec491447b90ad6a4056a9656b13f0b3a1e83043.tar.bz2 linux-stable-9ec491447b90ad6a4056a9656b13f0b3a1e83043.zip |
block: Suppress uevent for hidden device when removed
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/genhd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c index c55e8f0fced1..8c8f543572e6 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -534,10 +534,8 @@ static void register_disk(struct device *parent, struct gendisk *disk, kobject_create_and_add("holders", &ddev->kobj); disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); - if (disk->flags & GENHD_FL_HIDDEN) { - dev_set_uevent_suppress(ddev, 0); + if (disk->flags & GENHD_FL_HIDDEN) return; - } disk_scan_partitions(disk); |