summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-12-03 14:01:24 +1100
committerNeilBrown <neilb@suse.de>2013-12-03 14:01:24 +1100
commitb11fe74db0d764c3a245d95bc3651be9bbd59463 (patch)
tree8da452583d18057e67f65462a2e5dec2f4f3dee8 /mdadm.c
parent169ffac7ad7748c8586fd1d68b7a417d71133140 (diff)
Incremental: improve support for "DEVICE" based restriction in mdadm.conf
--incremental currently fails if the device name passed does not textually match the names permitted by the DEVICE line in mdadm.conf. This is problematic when "mdadm -I" is run by udev as the name given can be a temp name. This patch makes two improvements: 1/ We generate a list of all existing devices that match the names in mdadm.conf, and allow rdev based matching 2/ We allows extra aliases to be provided on the command line, and perform textual matching on those. This is particularly suitable for udev usages as ${DEVLINKS} can be provided even though the links make not yet be created. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mdadm.c b/mdadm.c
index 359e9f91..f6f5b53a 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1553,16 +1553,16 @@ int main(int argc, char *argv[])
}
break;
}
- if (devlist->next) {
- pr_err("--incremental can only handle one device.\n");
- rv = 1;
- break;
- }
- if (devmode == 'f')
+ if (devmode == 'f') {
+ if (devlist->next) {
+ pr_err("'--incremental --fail' can only handle one device.\n");
+ rv = 1;
+ break;
+ }
rv = IncrementalRemove(devlist->devname, remove_path,
c.verbose);
- else
- rv = Incremental(devlist->devname, &c, ss);
+ } else
+ rv = Incremental(devlist, &c, ss);
break;
case AUTODETECT:
autodetect();