rpms/mdadm/devel mdadm-3.1.2-container.patch, NONE, 1.1 mdadm.rules, 1.12, 1.13 mdadm.spec, 1.91, 1.92

Doug Ledford dledford at fedoraproject.org
Thu Apr 8 16:55:45 UTC 2010


Author: dledford

Update of /cvs/extras/rpms/mdadm/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv31996

Modified Files:
	mdadm.rules mdadm.spec 
Added Files:
	mdadm-3.1.2-container.patch 
Log Message:
* Tue Apr 06 2010 Doug Ledford <dledford at redhat.com> - 3.1.2-7
- Fix up directory in mdmonitor init script so that we restart mdmon like we
  are supposed to
- Add a rule to run incremental assembly on containers in case there are
  multiple volumes in a container and we only started some of them in the
  initramfs
- Make -If work with imsm arrays.  We had too restrictive of a test in
  sysfs_unique_holder.
- Make incremental assembly of containers act like incremental assembly of
  regular devices (aka, --run is needed to start a degraded array)


mdadm-3.1.2-container.patch:
 Assemble.c    |    6 ++++--
 Incremental.c |   23 ++++++++++++-----------
 super-intel.c |   17 ++++++++++++++++-
 3 files changed, 32 insertions(+), 14 deletions(-)

--- NEW FILE mdadm-3.1.2-container.patch ---
commit 3f45610e6b9e2419f09f7f1b415170b6128d91ad
Author: Doug Ledford <dledford at redhat.com>
Date:   Thu Apr 8 12:39:03 2010 -0400

    Make Incremental container assembly behave like native array assembly
    
    Signed-off-by: Doug Ledford <dledford at redhat.com>:4000

diff --git a/Assemble.c b/Assemble.c
index 1504f1f..d059155 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1327,8 +1327,10 @@ int assemble_container_content(struct supertype *st, int mdfd,
 		   content->text_version,
 		   content->uuid, chosen_name);
 
-	if (runstop > 0 ||
-		 (working + preexist) >= content->array.working_disks) {
+	if ((runstop > 0 &&
+	     (working + preexist) >= content->array.working_disks) ||
+	    (runstop == 0 &&
+	     (working + preexist) == content->array.raid_disks)) {
 		int err;
 
 		switch(content->array.level) {
diff --git a/Incremental.c b/Incremental.c
index d32a8e5..2a2df82 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -424,20 +424,21 @@ int Incremental(char *devname, int verbose, int runstop,
 		sysfs_uevent(&info, "change");
 		if (verbose >= 0)
 			fprintf(stderr, Name
-				": container %s now has %d devices\n",
-				chosen_name, info.array.working_disks);
+				": container %s now has %d out of %d devices\n",
+				chosen_name, info.array.working_disks,
+				info.array.raid_disks);
 		wait_for(chosen_name, mdfd);
 		close(mdfd);
-		if (runstop < 0)
-			return 0; /* don't try to assemble */
-		rv = Incremental(chosen_name, verbose, runstop,
-				 NULL, homehost, require_homehost, autof);
-		if (rv == 1)
-			/* Don't fail the whole -I if a subarray didn't
-			 * have enough devices to start yet
+		if (runstop == 1 ||
+		    info.array.working_disks == info.array.raid_disks)
+			/* The return value of our container assembly doesn't
+			 * depend on whether or not subarrays assembled
+			 * properly, so no need to preserve the return value
+			 * here.
 			 */
-			rv = 0;
-		return rv;
+			Incremental(chosen_name, verbose, runstop, NULL,
+				    homehost, require_homehost, autof);
+		return 0;
 	}
 	avail = NULL;
 	active_disks = count_active(st, mdfd, &avail, &info);
diff --git a/super-intel.c b/super-intel.c
index 999b970..7bcfcdb 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1536,12 +1536,27 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info)
 	if (super->current_vol >= 0) {
 		getinfo_super_imsm_volume(st, info);
 		return;
+	} else {
+		struct mdinfo vol_info;
+
+		super->current_vol = 0;
+		getinfo_super_imsm_volume(st, &vol_info);
+		super->current_vol = -1;
+		info->array.raid_disks = vol_info.array.raid_disks;
 	}
 
 	/* Set raid_disks to zero so that Assemble will always pull in valid
 	 * spares
-	 */
+	 *
+	 * Note: my testing with assemble shows that it still works even
+	 * when we set the raid_disks to a proper setting.  However, without
+	 * this it is impossible to tell when a container has the right
+	 * number of disks to start cleanly without violating layering
+	 * boundaries.  So, not violating layering boundaries trumps spare
+	 * disk issues.  Doug Ledford
+	 *
 	info->array.raid_disks    = 0;
+	 */
 	info->array.level         = LEVEL_CONTAINER;
 	info->array.layout        = 0;
 	info->array.md_minor      = -1;


Index: mdadm.rules
===================================================================
RCS file: /cvs/extras/rpms/mdadm/devel/mdadm.rules,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- mdadm.rules	7 Apr 2010 13:58:53 -0000	1.12
+++ mdadm.rules	8 Apr 2010 16:55:45 -0000	1.13
@@ -15,7 +15,7 @@ ENV{rd_NO_MDIMSM}=="?*", GOTO="md_imsm_i
 # file, we will need to add this line into the middle of the next rule:
 #	IMPORT{program}="/sbin/mdadm -D --export $tempnode", \
 
-SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="md*", \
+SUBSYSTEM=="block", ACTION=="add", KERNEL=="md*", \
 	ENV{MD_LEVEL}=="container", RUN+="/sbin/mdadm -I $tempnode"
 
 SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \


Index: mdadm.spec
===================================================================
RCS file: /cvs/extras/rpms/mdadm/devel/mdadm.spec,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -p -r1.91 -r1.92
--- mdadm.spec	7 Apr 2010 13:58:53 -0000	1.91
+++ mdadm.spec	8 Apr 2010 16:55:45 -0000	1.92
@@ -14,9 +14,10 @@ Patch4:      mdadm-3.1.2-rebuild.patch
 Patch5:      mdadm-3.1.2-directory.patch
 Patch6:      mdadm-3.1.2-decremental.patch
 Patch7:      mdadm-3.1.2-decremental-2.patch
-Patch10:     mdadm-3.1.2-decremental-3.patch
-Patch8:      mdadm-3.1.2-powerpc-compile.patch
-Patch9:      mdadm-2.5.2-static.patch
+Patch8:      mdadm-3.1.2-decremental-3.patch
+Patch9:      mdadm-3.1.2-powerpc-compile.patch
+Patch10:     mdadm-3.1.2-container.patch
+Patch20:     mdadm-2.5.2-static.patch
 URL:         http://www.kernel.org/pub/linux/utils/raid/mdadm/
 License:     GPLv2+
 Group:       System Environment/Base
@@ -44,9 +45,10 @@ file can be used to help with some commo
 %patch5 -p1 -b .directory
 %patch6 -p1 -b .decremental
 %patch7 -p1 -b .decremental-2
-%patch10 -p1 -b .decremental-3
-%patch8 -p1 -b .powerpc
-%patch9 -p1 -b .static
+%patch8 -p1 -b .decremental-3
+%patch9 -p1 -b .powerpc
+%patch10 -p1 -b .contrainer
+%patch20 -p1 -b .static
 
 %build
 make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" SYSCONFDIR="%{_sysconfdir}" mdadm.static mdadm mdmon
@@ -101,6 +103,8 @@ fi
   initramfs
 - Make -If work with imsm arrays.  We had too restrictive of a test in
   sysfs_unique_holder.
+- Make incremental assembly of containers act like incremental assembly of
+  regular devices (aka, --run is needed to start a degraded array)
 
 * Tue Apr 06 2010 Doug Ledford <dledford at redhat.com> - 3.1.2-6
 - Typo in new rules file



More information about the scm-commits mailing list