]> Git Repo - linux.git/commitdiff
md: notify userspace on 'stop' events
authorDan Williams <[email protected]>
Fri, 23 May 2008 20:04:37 +0000 (13:04 -0700)
committerLinus Torvalds <[email protected]>
Sat, 24 May 2008 16:56:10 +0000 (09:56 -0700)
This additional notification to 'array_state' is needed to allow the
monitor application to learn about stop events via sysfs.  The
sysfs_notify("sync_action") call that comes at the end of do_md_stop()
(via md_new_event) is insufficient since the 'sync_action' attribute has
been removed by this point.

(Seems like a sysfs-notify-on-removal patch is a better fix.  Currently
removal updates the event count but does not wake up waiters)

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Neil Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/md/md.c

index 52f9865096c6807520747d0e9c01cec1d3fea29c..e57213dacd25f969178da804d30481cfaf491b22 100644 (file)
@@ -3691,6 +3691,8 @@ static int do_md_stop(mddev_t * mddev, int mode)
 
                        module_put(mddev->pers->owner);
                        mddev->pers = NULL;
+                       /* tell userspace to handle 'inactive' */
+                       sysfs_notify(&mddev->kobj, NULL, "array_state");
 
                        set_capacity(disk, 0);
                        mddev->changed = 1;
This page took 0.048938 seconds and 4 git commands to generate.