summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-06-19 03:39:14 +0200
committerNeilBrown <neilb@suse.de>2013-06-19 03:39:14 +0200
commite6dd89da86813679fae44e472ea470a943f133e2 (patch)
treed8450525b2b2eb4e15280c4c6a5a2034db213709 /mdadm.c
parentManage: split Manage_runstop into Manage_run and Manage_stop (diff)
downloadmdadm-e6dd89da86813679fae44e472ea470a943f133e2.tar.xz
mdadm-e6dd89da86813679fae44e472ea470a943f133e2.zip
Manage: allow "--stop" on kernel names.
e.g. mdadm --stop md4 This works even if udev has become confused or killed. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index fe6c2fa8..37360bde 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1803,7 +1803,13 @@ static int misc_list(struct mddev_dev *devlist,
(dv == devlist && dv->next == NULL));
continue;
}
- mdfd = open_mddev(dv->devname, 1);
+ if (dv->devname[0] == '/')
+ mdfd = open_mddev(dv->devname, 1);
+ else {
+ mdfd = open_dev(dv->devname);
+ if (mdfd < 0)
+ pr_err("Cannot open %s\n", dv->devname);
+ }
if (mdfd>=0) {
switch(dv->disposition) {
case 'R':