Fix oddity where mdadm did not recognise a relative path
mdadm assumed that a pathname started with a "/", while an array name didn't. This alters the logic so that if the first character is not a "/" it tries to open an array, and if that fails it drops through to the pathname code rather than terminating immediately with an error. Signed-off-by: Wol <anthony@youngman.org.uk> Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
This commit is contained in:
parent
565cc99e34
commit
bb6f40bf9c
10
mdadm.c
10
mdadm.c
|
@ -1899,12 +1899,12 @@ static int misc_list(struct mddev_dev *devlist,
|
||||||
rv |= SetAction(dv->devname, c->action);
|
rv |= SetAction(dv->devname, c->action);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (dv->devname[0] == '/')
|
switch(dv->devname[0] == '/') {
|
||||||
mdfd = open_mddev(dv->devname, 1);
|
case 0:
|
||||||
else {
|
|
||||||
mdfd = open_dev(dv->devname);
|
mdfd = open_dev(dv->devname);
|
||||||
if (mdfd < 0)
|
if (mdfd >= 0) break;
|
||||||
pr_err("Cannot open %s\n", dv->devname);
|
case 1:
|
||||||
|
mdfd = open_mddev(dv->devname, 1);
|
||||||
}
|
}
|
||||||
if (mdfd>=0) {
|
if (mdfd>=0) {
|
||||||
switch(dv->disposition) {
|
switch(dv->disposition) {
|
||||||
|
|
Loading…
Reference in New Issue