NeilBrown: Assemble: check inargv before complaining about stray arguments.

Martin F. Krafft madduck at alioth.debian.org
Mon May 24 09:21:03 UTC 2010


Module: mdadm
Branch: upstream
Commit: 4c1c3ad8cf69763a4c8c4ba692a8cb93327a4abf
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=4c1c3ad8cf69763a4c8c4ba692a8cb93327a4abf

Author: NeilBrown <neilb at suse.de>
Date:   Wed Feb 24 11:43:59 2010 +1100

Assemble: check inargv before complaining about stray arguments.

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 at suse.de>
Acked-by: Dan Williams <dan.j.williams at intel.com>

---

 Assemble.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index e4d6181..23cc438 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -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);




More information about the pkg-mdadm-commits mailing list