When new paths are added in update_pathvec_from_dm(). If they can't get their regular wwid, they shouldn't try the getting the fallback wwid, and should just copy the wwid of the multipath device.
Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com> Reviewed-by: Martin Wilck <mwi...@suse.com> --- libmultipath/discovery.c | 7 ++++--- libmultipath/discovery.h | 2 ++ libmultipath/structs_vec.c | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index f25fe9e3..5edf9593 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -2363,15 +2363,16 @@ int pathinfo(struct path *pp, struct config *conf, int mask) } if ((mask & DI_WWID) && !strlen(pp->wwid)) { - get_uid(pp, path_state, pp->udev, - (pp->retriggers >= conf->retrigger_tries)); + int allow_fallback = ((mask & DI_NOFALLBACK) == 0 && + pp->retriggers >= conf->retrigger_tries); + get_uid(pp, path_state, pp->udev, allow_fallback); if (!strlen(pp->wwid)) { if (pp->bus == SYSFS_BUS_UNDEF) return PATHINFO_SKIPPED; if (pp->initialized != INIT_FAILED) { pp->initialized = INIT_MISSING_UDEV; pp->tick = conf->retrigger_delay; - } else if (pp->retriggers >= conf->retrigger_tries && + } else if (allow_fallback && (pp->state == PATH_UP || pp->state == PATH_GHOST)) { /* * We have failed to read udev info for this path diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index a5446b4d..095657bb 100644 --- a/libmultipath/discovery.h +++ b/libmultipath/discovery.h @@ -70,6 +70,7 @@ enum discovery_mode { __DI_WWID, __DI_BLACKLIST, __DI_NOIO, + __DI_NOFALLBACK, }; #define DI_SYSFS (1 << __DI_SYSFS) @@ -79,6 +80,7 @@ enum discovery_mode { #define DI_WWID (1 << __DI_WWID) #define DI_BLACKLIST (1 << __DI_BLACKLIST) #define DI_NOIO (1 << __DI_NOIO) /* Avoid IO on the device */ +#define DI_NOFALLBACK (1 << __DI_NOFALLBACK) /* do not allow wwid fallback */ #define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \ DI_WWID) diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index 4d56107a..d363e7f6 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -182,8 +182,7 @@ bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp, conf); pp->checkint = conf->checkint; rc = pathinfo(pp, conf, - DI_SYSFS|DI_WWID|DI_BLACKLIST| - pathinfo_flags); + DI_SYSFS|DI_WWID|DI_BLACKLIST|DI_NOFALLBACK|pathinfo_flags); pthread_cleanup_pop(1); if (rc != PATHINFO_OK) { condlog(1, "%s: error %d in pathinfo, discarding path", -- 2.17.2 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel