summaryrefslogtreecommitdiff
path: root/mdopen.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-03-10 16:28:22 +1100
committerNeilBrown <neilb@suse.de>2009-03-10 16:28:22 +1100
commitadd394f39e16445a7975bd00fea69ed2bda05b70 (patch)
treef6440b1e6652a36e2ff9ccbac66755251dbae5ea /mdopen.c
parentecb02e31d5e29bda0d9d9c7ae073f8379c7558d5 (diff)
downloadmdadm-add394f39e16445a7975bd00fea69ed2bda05b70.tar.gz
mdopen: be more careful when adding digit to names.
If we need to add digits to a name to make it unique, but don't have to add '_', we need to avoid adding a digit immediately after a digit. So if the last character of the name is a digit, add the '_' anyway. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdopen.c')
-rw-r--r--mdopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mdopen.c b/mdopen.c
index b4d7bdc..5d478f5 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -291,7 +291,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
}
cnlen = strlen(cname);
while (conflict) {
- if (trustworthy == METADATA)
+ if (trustworthy == METADATA && !isdigit(cname[cnlen-1]))
sprintf(cname+cnlen, "%d", unum);
else
/* add _%d to FOREIGN array that don't