diff options
author | NeilBrown <neilb@suse.de> | 2009-10-19 17:11:15 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-10-19 17:11:15 +1100 |
commit | 5ac6db12f9f970f26b7017517789bac200631b11 (patch) | |
tree | 60b21560c5b4f11eb27fa6919fc85979d0852231 | |
parent | 8a0a0ded4af12be6db97abba7551923da3bcf8c9 (diff) | |
download | mdadm-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); |