diff options
author | NeilBrown <neilb@suse.de> | 2009-03-10 16:28:22 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-10 16:28:22 +1100 |
commit | add394f39e16445a7975bd00fea69ed2bda05b70 (patch) | |
tree | f6440b1e6652a36e2ff9ccbac66755251dbae5ea | |
parent | ecb02e31d5e29bda0d9d9c7ae073f8379c7558d5 (diff) | |
download | mdadm-add394f39e16445a7975bd00fea69ed2bda05b70.tar.gz mdadm-add394f39e16445a7975bd00fea69ed2bda05b70.tar.xz mdadm-add394f39e16445a7975bd00fea69ed2bda05b70.zip |
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>
-rw-r--r-- | mdopen.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |