Commit 7870db4c authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] md: send online/offline uevents when an md array starts/stops

This allows udev to do something intelligent when an array becomes
available.
Acked-by: default avatarGreg KH <greg@kroah.com>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent df66b855
...@@ -3200,6 +3200,7 @@ static int do_md_run(mddev_t * mddev) ...@@ -3200,6 +3200,7 @@ static int do_md_run(mddev_t * mddev)
mddev->changed = 1; mddev->changed = 1;
md_new_event(mddev); md_new_event(mddev);
kobject_uevent(&mddev->gendisk->kobj, KOBJ_ONLINE);
return 0; return 0;
} }
...@@ -3313,6 +3314,7 @@ static int do_md_stop(mddev_t * mddev, int mode) ...@@ -3313,6 +3314,7 @@ static int do_md_stop(mddev_t * mddev, int mode)
module_put(mddev->pers->owner); module_put(mddev->pers->owner);
mddev->pers = NULL; mddev->pers = NULL;
kobject_uevent(&mddev->gendisk->kobj, KOBJ_OFFLINE);
if (mddev->ro) if (mddev->ro)
mddev->ro = 0; mddev->ro = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment