Skip to content

Commit

Permalink
md: notify userspace on 'stop' events
Browse files Browse the repository at this point in the history
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 <dan.j.williams@intel.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Williams authored and Linus Torvalds committed May 24, 2008
1 parent 09a44cc commit 4f54b0e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f54b0e

Please sign in to comment.