summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-10-19 17:11:15 +1100
committerNeilBrown <neilb@suse.de>2009-10-19 17:11:15 +1100
commit5ac6db12f9f970f26b7017517789bac200631b11 (patch)
tree60b21560c5b4f11eb27fa6919fc85979d0852231
parent8a0a0ded4af12be6db97abba7551923da3bcf8c9 (diff)
downloadmdadm-5ac6db12f9f970f26b7017517789bac200631b11.tar.gz
mdadm-5ac6db12f9f970f26b7017517789bac200631b11.tar.xz
mdadm-5ac6db12f9f970f26b7017517789bac200631b11.zip
mdopen: only use 'dev' as chosen name if it is a full path.
Otherwise using names like "r0" causes problem. They are handled sufficiently by other paths in the code. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--mdopen.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mdopen.c b/mdopen.c
index d322cf4..ed53d6f 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -156,7 +156,6 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
if (dev) {
-
if (strncmp(dev, "/dev/md/", 8) == 0) {
strcpy(cname, dev+8);
} else if (strncmp(dev, "/dev/", 5) == 0) {
@@ -307,7 +306,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
}
}
- if (dev)
+ if (dev && dev[0] == '/')
strcpy(chosen, dev);
else if (cname[0] == 0)
strcpy(chosen, devname);