diff options
author | NeilBrown <neilb@suse.de> | 2008-11-04 10:50:39 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-11-04 10:50:39 +0100 |
commit | 975903767837c572971675a7bf6d866d3be5fa56 (patch) | |
tree | e199783fd86efde8dc1049f37021ed82a87c37ec /Create.c | |
parent | Add udev rules file for mdadm. (diff) | |
download | 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 'Create.c')
-rw-r--r-- | Create.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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, ¶m)) { fprintf(stderr, Name ": RUN_ARRAY failed: %s\n", |