diff options
author | NeilBrown <neilb@suse.de> | 2008-11-04 20:50:39 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-11-04 20:50:39 +1100 |
commit | 975903767837c572971675a7bf6d866d3be5fa56 (patch) | |
tree | e199783fd86efde8dc1049f37021ed82a87c37ec /Incremental.c | |
parent | 757a5d74ff11aadb87c9ff8e038c7140d2c457a8 (diff) | |
download | mdadm-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 'Incremental.c')
-rw-r--r-- | Incremental.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Incremental.c b/Incremental.c index 1cccdf7..f0f0c00 100644 --- a/Incremental.c +++ b/Incremental.c @@ -376,6 +376,7 @@ int Incremental(char *devname, int verbose, int runstop, if (info.array.level == LEVEL_CONTAINER) { /* Try to assemble within the container */ close(mdfd); + sysfs_uevent(&info, "change"); if (verbose >= 0) fprintf(stderr, Name ": container %s now has %d devices\n", @@ -625,9 +626,15 @@ void RebuildMap(void) st->ss->free_super(st); break; } + sysfs_free(sra); } map_write(map); map_free(map); + for (md = mdstat ; md ; md = md->next) { + struct mdinfo *sra = sysfs_read(-1, md->devnum, GET_VERSION); + sysfs_uevent(sra, "change"); + sysfs_free(sra); + } } int IncrementalScan(int verbose) |