]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: check inargv before complaining about stray arguments.
authorNeilBrown <neilb@suse.de>
Wed, 24 Feb 2010 00:43:59 +0000 (11:43 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 24 Feb 2010 00:43:59 +0000 (11:43 +1100)
If --assemble is given a container and some other devices to assemble
an array from, it complains with an error because that doesn't make
sense.
However it currently also complains if the list of devices was extract
from the config file rather than being given on the command line.
That is not appropriate.

So add an '&& inargv' test to ensure that we are really complaining
about the right thing.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Assemble.c

index e4d61816369c2c0a0174e5c3da6eeda364d13925..23cc438de596a68437e476d1e0b9b51625e9794d 100644 (file)
@@ -434,7 +434,7 @@ int Assemble(struct supertype *st, char *mddev,
                                }
                        }
                        st = tst; tst = NULL;
-                       if (!auto_assem && tmpdev->next != NULL) {
+                       if (!auto_assem && inargv && tmpdev->next != NULL) {
                                fprintf(stderr, Name ": %s is a container, but is not "
                                        "only device given: confused and aborting\n",
                                        devname);