NeilBrown: Incremental: fix setting of 'autof' flag.

Martin F. Krafft madduck at alioth.debian.org
Mon Feb 16 10:52:38 UTC 2009


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

Author: NeilBrown <neilb at suse.de>
Date:   Thu Oct 30 09:34:06 2008 +1100

Incremental:  fix setting of 'autof' flag.

When doing auto-assembly, the 'autof' flag from array lines
in mdadm.conf was being ignored.

Signed-off-by: NeilBrown <neilb at suse.de>

---

 Incremental.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index 5d26b77..d61518a 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -83,12 +83,8 @@ int Incremental(char *devname, int verbose, int runstop,
 	int dfd, mdfd;
 	char *avail;
 	int active_disks;
-
-
 	struct createinfo *ci = conf_get_create_info();
 
-	if (autof == 0)
-		autof = ci->autof;
 
 	/* 1/ Check if devices is permitted by mdadm.conf */
 
@@ -221,6 +217,16 @@ int Incremental(char *devname, int verbose, int runstop,
 	/* - Choose a free, high number. */
 	/* - Use a partitioned device unless strong suggestion not to. */
 	/*         e.g. auto=md */
+
+	/* 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.
+	 */
+	if (autof == 0 && match)
+		autof = match->autof;
+	if (autof == 0)
+		autof = ci->autof;
+
 	if (match && (rv = is_standard(match->devname, &devnum))) {
 		devnum = (rv > 0) ? (-1-devnum) : devnum;
 	} else if ((mp = map_by_uuid(&map, info.uuid)) != NULL)




More information about the pkg-mdadm-commits mailing list