]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] md: send online/offline uevents when an md array starts/stops
authorNeilBrown <neilb@suse.de>
Fri, 3 Nov 2006 06:06:57 +0000 (22:06 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 3 Nov 2006 20:27:55 +0000 (12:27 -0800)
This allows udev to do something intelligent when an array becomes
available.

Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/md.c

index 50ab4a936e30a3e405e314f648049c518446e018..d111356044038453e782053f66b22d3b555257a7 100644 (file)
@@ -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;
                }