]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Incremental: change precedence order for autof setting.
authorNeilBrown <neilb@suse.de>
Sun, 2 Nov 2008 19:39:02 +0000 (06:39 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 2 Nov 2008 19:39:02 +0000 (06:39 +1100)
It doesn't really make sense for the --auto setting to ever over-ride
the setting on an ARRAY line.  That could cause failure if the
ARRAY line has a 'standard' now.  So revert to the array line having
precedence over command line, then CREATE line last.

Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c

index 7148a734a883b598adb2b3fb40e67ff537e6d85b..1d326fdabf4769fa165c5b6435d146cc8e09a48c 100644 (file)
@@ -40,7 +40,7 @@ int Incremental(char *devname, int verbose, int runstop,
                struct supertype *st, char *homehost, int autof)
 {
        /* Add this device to an array, creating the array if necessary
-        * and starting the array if sensibe or - if runstop>0 - if possible.
+        * and starting the array if sensible or - if runstop>0 - if possible.
         *
         * This has several steps:
         *
@@ -225,9 +225,10 @@ int Incremental(char *devname, int verbose, int runstop,
 
        /* There are three possible sources for 'autof':  command line,
         * ARRAY line in mdadm.conf, or CREATE line in mdadm.conf.
-        * They have precedence in that order.
+        * ARRAY takes precedence, then command line, then
+        * CREATE.
         */
-       if (autof == 0 && match)
+       if (match && match->autof)
                autof = match->autof;
        if (autof == 0)
                autof = ci->autof;