From: NeilBrown Date: Fri, 3 Nov 2006 06:06:57 +0000 (-0800) Subject: [PATCH] md: send online/offline uevents when an md array starts/stops X-Git-Tag: v2.6.19-rc5~58 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7870db4c7fa1b03fec133c4f4e67fdaa04c5ac15;p=linux-2.6 [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: Greg KH Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 50ab4a936e..d111356044 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3200,6 +3200,7 @@ static int do_md_run(mddev_t * mddev) mddev->changed = 1; md_new_event(mddev); + kobject_uevent(&mddev->gendisk->kobj, KOBJ_ONLINE); return 0; } @@ -3313,6 +3314,7 @@ static int do_md_stop(mddev_t * mddev, int mode) module_put(mddev->pers->owner); mddev->pers = NULL; + kobject_uevent(&mddev->gendisk->kobj, KOBJ_OFFLINE); if (mddev->ro) mddev->ro = 0; }