Only signal a udev change event if we actually write a mapfile in RebuildMap

Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Doug Ledford 2010-03-17 09:28:07 -04:00 committed by NeilBrown
parent e259df4e63
commit 7bf59f5c16
1 changed files with 8 additions and 6 deletions

View File

@ -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);
}