From 69267a30bed1fabec658058c63845528a8b813d4 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Thu, 13 Dec 2007 14:15:57 +0000 Subject: [PATCH] dm: trigger change uevent on rename Insert a missing KOBJ_CHANGE notification when a device is renamed. Cc: Scott James Remnant Signed-off-by: Alasdair G Kergon --- drivers/md/dm-ioctl.c | 2 ++ drivers/md/dm.c | 7 ++++++- drivers/md/dm.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index be730fdd4830..9627fa0f9470 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -332,6 +332,8 @@ static int dm_hash_rename(const char *old, const char *new) dm_table_put(table); } + dm_kobject_uevent(hc->md); + dm_put(hc->md); up_write(&_hash_lock); kfree(old_name); diff --git a/drivers/md/dm.c b/drivers/md/dm.c index cff2a714c107..88c0fd657825 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1514,7 +1514,7 @@ int dm_resume(struct mapped_device *md) dm_table_unplug_all(map); - kobject_uevent(&md->disk->kobj, KOBJ_CHANGE); + dm_kobject_uevent(md); r = 0; @@ -1528,6 +1528,11 @@ out: /*----------------------------------------------------------------- * Event notification. *---------------------------------------------------------------*/ +void dm_kobject_uevent(struct mapped_device *md) +{ + kobject_uevent(&md->disk->kobj, KOBJ_CHANGE); +} + uint32_t dm_next_uevent_seq(struct mapped_device *md) { return atomic_add_return(1, &md->uevent_seq); diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 177297a88ebd..b4584a39383b 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -187,4 +187,6 @@ union map_info *dm_get_mapinfo(struct bio *bio); int dm_open_count(struct mapped_device *md); int dm_lock_for_deletion(struct mapped_device *md); +void dm_kobject_uevent(struct mapped_device *md); + #endif -- 2.30.2