select_alias (struct multipath * mp)
{
if (mp->mpe && mp->mpe->alias)
- mp->alias = mp->mpe->alias;
+ mp->alias = STRDUP(mp->mpe->alias);
else {
mp->alias = NULL;
if (conf->user_friendly_names) {
}
}
if (mp->alias == NULL)
- mp->alias = mp->wwid;
+ mp->alias = STRDUP(mp->wwid);
}
return 0;
return 0;
}
mp->pg_timeout = PGTIMEOUT_UNDEF;
- condlog(3, "pg_timeout = NONE (internal default)");
+ condlog(3, "%s: pg_timeout = NONE (internal default)", mp->alias);
return 0;
}
free_multipath_attributes(mpp);
- if (mpp->alias &&
- (!mpp->mpe || (mpp->mpe && mpp->alias != mpp->mpe->alias)) &&
- (mpp->wwid && mpp->alias != mpp->wwid)) {
+ if (mpp->alias) {
FREE(mpp->alias);
mpp->alias = NULL;
}
condlog(3, "%s: discover", mpp->alias);
if (update_multipath_strings(mpp, vecs->pathvec)) {
- char new_alias[WWID_SIZE];
+ char *new_alias;
+ new_alias = MALLOC(WWID_SIZE);
+ if (!new_alias) {
+ condlog(0, "%s: failed to allocate alias", mpp->alias);
+ goto out;
+ }
/*
* detect an external rename of the multipath device
*/
condlog(3, "%s multipath mapped device name has "
"changed from %s to %s", mpp->wwid,
mpp->alias, new_alias);
- strcpy(mpp->alias, new_alias);
+ FREE(mpp->alias);
+ mpp->alias = new_alias;
if (mpp->waiter)
strncpy(((struct event_thread *)mpp->waiter)->mapname,