Skip to content

Commit 69267a3

Browse files
committed
dm: trigger change uevent on rename
Insert a missing KOBJ_CHANGE notification when a device is renamed. Cc: Scott James Remnant <scott@ubuntu.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent adfe477 commit 69267a3

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

drivers/md/dm-ioctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ static int dm_hash_rename(const char *old, const char *new)
332332
dm_table_put(table);
333333
}
334334

335+
dm_kobject_uevent(hc->md);
336+
335337
dm_put(hc->md);
336338
up_write(&_hash_lock);
337339
kfree(old_name);

drivers/md/dm.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ int dm_resume(struct mapped_device *md)
15141514

15151515
dm_table_unplug_all(map);
15161516

1517-
kobject_uevent(&md->disk->kobj, KOBJ_CHANGE);
1517+
dm_kobject_uevent(md);
15181518

15191519
r = 0;
15201520

@@ -1528,6 +1528,11 @@ int dm_resume(struct mapped_device *md)
15281528
/*-----------------------------------------------------------------
15291529
* Event notification.
15301530
*---------------------------------------------------------------*/
1531+
void dm_kobject_uevent(struct mapped_device *md)
1532+
{
1533+
kobject_uevent(&md->disk->kobj, KOBJ_CHANGE);
1534+
}
1535+
15311536
uint32_t dm_next_uevent_seq(struct mapped_device *md)
15321537
{
15331538
return atomic_add_return(1, &md->uevent_seq);

drivers/md/dm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,6 @@ union map_info *dm_get_mapinfo(struct bio *bio);
187187
int dm_open_count(struct mapped_device *md);
188188
int dm_lock_for_deletion(struct mapped_device *md);
189189

190+
void dm_kobject_uevent(struct mapped_device *md);
191+
190192
#endif

0 commit comments

Comments
 (0)