From add394f39e16445a7975bd00fea69ed2bda05b70 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 10 Mar 2009 16:28:22 +1100 Subject: 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 --- mdopen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mdopen.c') 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 -- cgit v1.2.1