LKML Archive on
help / color / mirror / Atom feed
* [PATCH] block: send disk "change" event for rescan_partitions()
@ 2008-03-09 20:26 Kay Sievers
  0 siblings, 0 replies; only message in thread
From: Kay Sievers @ 2008-03-09 20:26 UTC (permalink / raw)
  To: LKML; +Cc: Greg KH, David Zeuthen

From: Kay Sievers <>
Subject: block: send disk "change" event for rescan_partitions()

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 <>

diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 03f808c..6149e4b 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -473,6 +473,10 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
 		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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-09 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-09 20:26 [PATCH] block: send disk "change" event for rescan_partitions() Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).