If a partial path appears and is not fully initialized within 180 seconds, trigger a uevent. If the udev device is not initialized trigger an add event. Otherwise, trigger a change event. Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> --- libmultipath/libmultipath.version | 2 +- libmultipath/structs.h | 1 + libmultipath/structs_vec.c | 1 + multipathd/main.c | 20 ++++++++++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version index 6473091d..58a7d1be 100644 --- a/libmultipath/libmultipath.version +++ b/libmultipath/libmultipath.version @@ -31,7 +31,7 @@ * The new version inherits the previous ones. */ -LIBMULTIPATH_10.0.0 { +LIBMULTIPATH_11.0.0 { global: /* symbols referenced by multipath and multipathd */ add_foreign; diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 69409fd4..c21d1eda 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -318,6 +318,7 @@ struct path { int fd; int initialized; int retriggers; + int partial_retrigger_delay; unsigned int path_failures; time_t dis_reinstate_time; int disable_reinstate; diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index 1de9175e..9b6407bd 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -195,6 +195,7 @@ bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, condlog(2, "%s: adding new path %s", mpp->alias, pp->dev); pp->initialized = INIT_PARTIAL; + pp->partial_retrigger_delay = 180; store_path(pathvec, pp); pp->tick = 1; } diff --git a/multipathd/main.c b/multipathd/main.c index 8f6be6b9..b0037721 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1948,6 +1948,25 @@ retry_count_tick(vector mpvec) } } +static void +partial_retrigger_tick(vector pathvec) +{ + struct path *pp; + unsigned int i; + + vector_foreach_slot (pathvec, pp, i) { + if (pp->initialized == INIT_PARTIAL && pp->udev && + pp->partial_retrigger_delay > 0 && + --pp->partial_retrigger_delay == 0) { + const char *msg = udev_device_get_is_initialized(pp->udev) ? + "change" : "add"; + + sysfs_attr_set_value(pp->udev, "uevent", msg, + strlen(msg)); + } + } +} + int update_prio(struct path *pp, int refresh_all) { int oldpriority; @@ -2566,6 +2585,7 @@ checkerloop (void *ap) retry_count_tick(vecs->mpvec); missing_uev_wait_tick(vecs); ghost_delay_tick(vecs); + partial_retrigger_tick(vecs->pathvec); lock_cleanup_pop(vecs->lock); if (count) -- 2.17.2 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel