summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-05-10 16:30:40 +1000
committerNeilBrown <neilb@suse.de>2011-05-10 16:30:40 +1000
commitdec18cae724516353ef911f5bed6c3bfee5845f1 (patch)
treea4d234346a97222b347e99e349b6eea0d3b441be /mdadm.c
parent873eec468c0b1b32332b5e4dd6b31e878e0e60e0 (diff)
Give suitable error for mdadm /dev/md0 --stop
Options like --stop must come before the device that is being stopped. If (in --misc mode) a device does not have an option, nothing will be done to it, which can be confusing. So report an error in this case. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mdadm.c b/mdadm.c
index 96d32b53..662822d1 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -253,6 +253,12 @@ int main(int argc, char *argv[])
exit(2);
} else if (!mode && newmode) {
mode = newmode;
+ if (mode == MISC && devs_found) {
+ fprintf(stderr, Name ": No action given for %s in --misc mode\n",
+ devlist->devname);
+ fprintf(stderr," Action options must come before device names\n");
+ exit(2);
+ }
} else {
/* special case of -c --help */
if ((opt == 'c' || opt == ConfigFile) &&