Skip to content

Commit 0f3649a

Browse files
snitmkergon
authored andcommitted
dm ioctl: only issue uevent on resume if state changed
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 <dwysocha@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Cc: stable@kernel.org Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent ede5ea0 commit 0f3649a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎drivers/md/dm-ioctl.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,16 +897,17 @@ static int do_resume(struct dm_ioctl *param)
897897
set_disk_ro(dm_disk(md), 1);
898898
}
899899

900-
if (dm_suspended_md(md))
900+
if (dm_suspended_md(md)) {
901901
r = dm_resume(md);
902+
if (!r)
903+
dm_kobject_uevent(md, KOBJ_CHANGE, param->event_nr);
904+
}
902905

903906
if (old_map)
904907
dm_table_destroy(old_map);
905908

906-
if (!r) {
907-
dm_kobject_uevent(md, KOBJ_CHANGE, param->event_nr);
909+
if (!r)
908910
r = __dev_status(md, param);
909-
}
910911

911912
dm_put(md);
912913
return r;

0 commit comments

Comments
 (0)