diff options
-rw-r--r-- | Incremental.c | 10 | ||||
-rw-r--r-- | util.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Incremental.c b/Incremental.c index 9c6524f..5d26b77 100644 --- a/Incremental.c +++ b/Incremental.c @@ -214,16 +214,16 @@ int Incremental(char *devname, int verbose, int runstop, } } /* 4/ Determine device number. */ - /* - If in mdadm.conf with std name, use that */ - /* - UUID in /var/run/mdadm.map use that */ + /* - If in mdadm.conf with std name, get number from name. */ + /* - UUID in /var/run/mdadm.map get number from mapping */ /* - If name is suggestive, use that. unless in use with */ /* different uuid. */ /* - Choose a free, high number. */ /* - Use a partitioned device unless strong suggestion not to. */ /* e.g. auto=md */ - if (match && is_standard(match->devname, &devnum)) - /* We have devnum now */; - else if ((mp = map_by_uuid(&map, info.uuid)) != NULL) + if (match && (rv = is_standard(match->devname, &devnum))) { + devnum = (rv > 0) ? (-1-devnum) : devnum; + } else if ((mp = map_by_uuid(&map, info.uuid)) != NULL) devnum = mp->devnum; else { /* Have to guess a bit. */ @@ -398,7 +398,7 @@ int is_standard(char *dev, int *nump) if (strncmp(d, "/d",2)==0) d += 2, type=1; /* /dev/md/dN{pM} */ else if (strncmp(d, "/md_d", 5)==0) - d += 5, type=1; /* /dev/md_dNpM */ + d += 5, type=1; /* /dev/md_dN{pM} */ else if (strncmp(d, "/md", 3)==0) d += 3, type=-1; /* /dev/mdN */ else if (d-dev > 3 && strncmp(d-2, "md/", 3)==0) |