diff options
author | Doug Ledford <dledford@redhat.com> | 2010-03-17 14:28:07 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-03-23 23:37:39 +0100 |
commit | 7bf59f5c16d928d3826fdf0c406d1aac5775e78b (patch) | |
tree | c3a54f3c264182acaf2f92d1c1c3b01080445a61 /mapfile.c | |
parent | mapfile: if we putting the mapfile in a custom location via ALT_RUN, allow (diff) | |
download | mdadm-7bf59f5c16d928d3826fdf0c406d1aac5775e78b.tar.xz mdadm-7bf59f5c16d928d3826fdf0c406d1aac5775e78b.zip |
Only signal a udev change event if we actually write a mapfile in RebuildMap
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'mapfile.c')
-rw-r--r-- | mapfile.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -471,12 +471,14 @@ void RebuildMap(void) } sysfs_free(sra); } - map_write(map); + /* Only trigger a change if we wrote a new map file */ + if (map_write(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); + } 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); - } free_mdstat(mdstat); } |