--- libmultipath/configure.c | 30 ++++++++++++++++++++++++++++-- libmultipath/wwids.c | 4 ++-- multipath/main.c | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) Index: multipath-tools-130222/libmultipath/configure.c =================================================================== --- multipath-tools-130222.orig/libmultipath/configure.c +++ multipath-tools-130222/libmultipath/configure.c @@ -38,6 +38,7 @@ #include "util.h" #include "uxsock.h" #include "wwids.h" +#include "sysfs.h" /* group paths in pg by host adapter */ @@ -569,6 +570,29 @@ fail: return 1; } +static void +trigger_uevents (struct multipath *mpp) +{ + struct pathgroup * pgp; + struct path * pp; + int i, j; + + if (!mpp || !mpp->pg) + return; + + vector_foreach_slot (mpp->pg, pgp, i) { + if (!pgp->paths) + continue; + vector_foreach_slot(pgp->paths, pp, j) { + if (!pp->udev) + continue; + sysfs_attr_set_value(pp->udev, "uevent", "change", + strlen("change")); + } + } +} + + /* * Return value: */ @@ -658,8 +682,10 @@ domap (struct multipath * mpp, char * pa * DM_DEVICE_CREATE, DM_DEVICE_RENAME, or DM_DEVICE_RELOAD * succeeded */ - if (mpp->action == ACT_CREATE) - remember_wwid(mpp->wwid); + if (mpp->action == ACT_CREATE) { + if (remember_wwid(mpp->wwid) == 1) + trigger_uevents(mpp); + } if (!conf->daemon) { /* multipath client mode */ dm_switchgroup(mpp->alias, mpp->bestpg); Index: multipath-tools-130222/libmultipath/wwids.c =================================================================== --- multipath-tools-130222.orig/libmultipath/wwids.c +++ multipath-tools-130222/libmultipath/wwids.c @@ -310,7 +310,7 @@ remember_wwid(char *wwid) } else condlog(4, "wwid %s already in wwids file", wwid); - return 0; + return ret; } int remember_cmdline_wwid(void) @@ -344,7 +344,7 @@ int remember_cmdline_wwid(void) next++; } if (strlen(ptr)) { - if (remember_wwid(ptr) != 0) + if (remember_wwid(ptr) < 0) ret = -1; } else { Index: multipath-tools-130222/multipath/main.c =================================================================== --- multipath-tools-130222.orig/multipath/main.c +++ multipath-tools-130222/multipath/main.c @@ -303,7 +303,7 @@ configure (void) } if (conf->cmd == CMD_ADD_WWID) { r = remember_wwid(refwwid); - if (r == 0) + if (r >= 0) printf("wwid '%s' added\n", refwwid); else printf("failed adding '%s' to wwids file\n",