unlink(mapname[2]);
fclose(lf);
}
+ if (*melp)
+ map_free(*melp);
lf = NULL;
}
{
FILE *f;
char buf[8192];
- char path[200];
+ char path[201];
int uuid[4];
char devnm[32];
char metadata[30];
map_delete(mapp, devnm);
map_write(*mapp);
map_free(*mapp);
+ *mapp = NULL;
}
struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4])
char dn[30];
int dfd;
int ok;
- int devid;
+ dev_t devid;
struct supertype *st;
char *subarray = NULL;
char *path;
if ((homehost == NULL ||
st->ss->match_home(st, homehost) != 1) &&
st->ss->match_home(st, "any") != 1 &&
- (require_homehost
- || ! conf_name_is_free(info->name)))
+ (require_homehost ||
+ !conf_name_is_free(info->name)))
/* require a numeric suffix */
unum = 0;
else
sep = "";
}
}
- if (strchr(name, ':'))
- /* probably a uniquifying
+ if (strchr(name, ':')) {
+ /* Probably a uniquifying
* hostname prefix. Allow
- * without a suffix
+ * without a suffix, and strip
+ * hostname if it is us.
*/
+ if (homehost && unum == -1 &&
+ strncmp(name, homehost,
+ strlen(homehost)) == 0 &&
+ name[strlen(homehost)] == ':')
+ name += strlen(homehost)+1;
unum = -1;
+ }
while (conflict) {
if (unum >= 0)