From: Hannes Reinecke <hare@suse.de>

device-mapper: send 'change' uevent for device-mapper table resume

Device-mapper tables are only ever usable after a 'resume'
ioctl has been issued. But to know when this happens we need to
generate an uevent to notify udev, so that it can take appropriate
action.

As discussed with agk and kay at OLS we should be sending 'change' events
for resume; events on suspend don't give you anything interesting and indeed
might lead to failures as any I/O on that table will be blocked anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>

Index: linux-2.6.17/drivers/md/dm.c
===================================================================
--- linux-2.6.17.orig/drivers/md/dm.c	2006-08-15 15:12:17.000000000 +0100
+++ linux-2.6.17/drivers/md/dm.c	2006-08-15 15:13:02.000000000 +0100
@@ -1380,6 +1380,8 @@ int dm_resume(struct mapped_device *md)
 
 	dm_table_unplug_all(map);
 
+	kobject_uevent(&md->disk->kobj, KOBJ_CHANGE);
+
 	r = 0;
 
 out:
