summaryrefslogtreecommitdiff
path: root/Create.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 /Create.c
parent757a5d74ff11aadb87c9ff8e038c7140d2c457a8 (diff)
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 'Create.c')
-rw-r--r--Create.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Create.c b/Create.c
index 23047c93..a66ed0ce 100644
--- a/Create.c
+++ b/Create.c
@@ -735,11 +735,12 @@ int Create(struct supertype *st, char *mddev,
free(infos);
st->ss->free_super(st);
- /* param is not actually used */
- if (level == LEVEL_CONTAINER)
- /* No need to start */
+ if (level == LEVEL_CONTAINER) {
+ /* No need to start. But we should signal udev to
+ * create links */
+ sysfs_uevent(&info, "change");
;
- else if (runstop == 1 || subdevs >= raiddisks) {
+ } else if (runstop == 1 || subdevs >= raiddisks) {
if (st->ss->external) {
switch(level) {
case LEVEL_LINEAR:
@@ -756,6 +757,7 @@ int Create(struct supertype *st, char *mddev,
}
sysfs_set_safemode(&info, safe_mode_delay);
} else {
+ /* param is not actually used */
mdu_param_t param;
if (ioctl(mdfd, RUN_ARRAY, &param)) {
fprintf(stderr, Name ": RUN_ARRAY failed: %s\n",