From: Mike Snitzer <[email-masked]>

Only issue a uevent on a resume if the state of the device changed,
i.e. if it was suspended and/or its table was replaced.

Signed-off-by: Dave Wysochanski <[email-masked]>
Signed-off-by: Mike Snitzer <[email-masked]>
Cc: [email-masked]
Signed-off-by: Alasdair G Kergon <[email-masked]>

---
 drivers/md/dm-ioctl.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Index: linux-2.6.33-rc8/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.33-rc8.orig/drivers/md/dm-ioctl.c
+++ linux-2.6.33-rc8/drivers/md/dm-ioctl.c
@@ -897,16 +897,17 @@ static int do_resume(struct dm_ioctl *pa
 			set_disk_ro(dm_disk(md), 1);
 	}
 
-	if (dm_suspended_md(md))
+	if (dm_suspended_md(md)) {
 		r = dm_resume(md);
+		if (!r)
+			dm_kobject_uevent(md, KOBJ_CHANGE, param->event_nr);
+	}
 
 	if (old_map)
 		dm_table_destroy(old_map);
 
-	if (!r) {
-		dm_kobject_uevent(md, KOBJ_CHANGE, param->event_nr);
+	if (!r)
 		r = __dev_status(md, param);
-	}
 
 	dm_put(md);
 	return r;