From: Kay Sievers <kay.sievers@vrfy.org>
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 <david@fubar.dk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
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;
--
| Ryan Hope | reiser4 for 2.6.27-rc1 |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| majkls | sys_chroot+sys_fchdir Fix |
| Pierre Ossman | Re: [RFC][PATCH] cpuidle: avoid singing capacitors |
git: | |
| Randal L. Schwartz | [BUG] daemon.c blows up on OSX (was Re: What's in git.git (stable), and Announcing... |
| Shawn O. Pearce | Re: Smart fetch via HTTP? |
| Jakub Narebski | Re: VCS comparison table |
| Johannes Schindelin | Re: rc4 - make quick-install-doc is broken |
| Henning Brauer | Re: httpdv6 |
| Edd Barrett | Re: Cold Boot Attacks on Encryption Keys |
| stuartv | Re: Microsoft gets the Most Secure Operating Systems award |
| Sunnz | How do I configure sendmail? |
| Stephen Pierce | SLS |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Dave `geek' Gymer | WARNING (was Re: New afio release) |
| Anthony Peacock | Re: ACK! Something's wrong with X! :( |
