From kay.sievers@vrfy.org Wed Mar 12 14:47:09 2008 From: Kay Sievers Date: Sun, 09 Mar 2008 21:26:02 +0100 Subject: block: send disk "change" event for rescan_partitions() Cc: Greg KH , David Zeuthen Message-ID: <1205094362.2366.2.camel@lov.site> From: Kay Sievers Userspace likes to get notified that the disk may have changed, when rescan_partitions() is called after partitioning or media change. It will make it possible to update the state of the disk with the "change" event, before the following partition "add" events are handled. Cc: David Zeuthen Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- fs/partitions/check.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -473,6 +473,10 @@ int rescan_partitions(struct gendisk *di return 0; if (IS_ERR(state)) /* I/O error reading the partition table */ return -EIO; + + /* tell userspace that the media / partition table may have changed */ + kobject_uevent(&disk->dev.kobj, KOBJ_CHANGE); + for (p = 1; p < state->limit; p++) { sector_t size = state->parts[p].size; sector_t from = state->parts[p].from;