summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-11-04 20:50:39 +1100
committerNeilBrown <neilb@suse.de>2008-11-04 20:50:39 +1100
commit975903767837c572971675a7bf6d866d3be5fa56 (patch)
treee199783fd86efde8dc1049f37021ed82a87c37ec /Manage.c
parent757a5d74ff11aadb87c9ff8e038c7140d2c457a8 (diff)
downloadmdadm-975903767837c572971675a7bf6d866d3be5fa56.tar.gz
mdadm-975903767837c572971675a7bf6d866d3be5fa56.tar.xz
mdadm-975903767837c572971675a7bf6d866d3be5fa56.zip
Generate 'change' uevents when arrays change in non-obvious ways.
When a 'container' gets started, we need udev to notice, but the kernel has no way of knowing that a KOBJ_CHANGE event is needed. So send one directly via the 'uevent' sysfs attribute. Also, uevents don't get generated when md arrays are stopped (prior to 2.6.28) so send 'change' events then too. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Manage.c b/Manage.c
index 6b9825b..fea563a 100644
--- a/Manage.c
+++ b/Manage.c
@@ -195,8 +195,6 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
*/
ping_monitor(mdi->sys_name);
}
- if (mdi)
- sysfs_free(mdi);
if (fd >= 0 && ioctl(fd, STOP_ARRAY, NULL)) {
if (quiet == 0) {
@@ -208,8 +206,15 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
"process, mounted filesystem "
"or active volume group?\n");
}
+ if (mdi)
+ sysfs_free(mdi);
return 1;
}
+ /* prior to 2.6.28, KOBJ_CHANGE was not sent when an md array
+ * was stopped, so We'll do it here just to be sure.
+ */
+ if (mdi)
+ sysfs_uevent(mdi, "change");
if (quiet <= 0)
fprintf(stderr, Name ": stopped %s\n", devname);