diff options
author | NeilBrown <neilb@suse.de> | 2009-03-10 06:28:22 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-10 06:28:22 +0100 |
commit | add394f39e16445a7975bd00fea69ed2bda05b70 (patch) | |
tree | f6440b1e6652a36e2ff9ccbac66755251dbae5ea /mdopen.c | |
parent | Incremental: fix some handling of trustworthy. (diff) | |
download | 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>
Diffstat (limited to 'mdopen.c')
-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 |