[mdadm/f20] Fix two mdadm bugs

Jes Sorensen jsorensen at fedoraproject.org
Tue Jul 29 08:27:14 UTC 2014


commit fa788c83406d95984d404dddd64cba59b74c1c96
Author: Jes Sorensen <Jes.Sorensen at redhat.com>
Date:   Tue Jul 29 10:13:22 2014 +0200

    Fix two mdadm bugs
    
    1) Improve error message when trying to use --grow -n<X> on a Linear
       array
    2) Allow assembly of explicitly specified arrays, even if they are
       disabled in /etc/mdadm.conf
    
    Resolves: bz#1122146, bz#1124310
    
    Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>

 ...ly-fail-auto-assemble-in-face-of-mdadm.co.patch |   85 ++++++++++++++++++++
 ...e-error-message-is-grow-n2-used-on-Linear.patch |   38 +++++++++
 mdadm.spec                                         |   12 +++-
 3 files changed, 134 insertions(+), 1 deletions(-)
---
diff --git a/mdadm-3.3.1-Assemble-Only-fail-auto-assemble-in-face-of-mdadm.co.patch b/mdadm-3.3.1-Assemble-Only-fail-auto-assemble-in-face-of-mdadm.co.patch
new file mode 100644
index 0000000..5215789
--- /dev/null
+++ b/mdadm-3.3.1-Assemble-Only-fail-auto-assemble-in-face-of-mdadm.co.patch
@@ -0,0 +1,85 @@
+From 5141638c54535b4ac80b8481404d868a63a18ecd Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb at suse.de>
+Date: Tue, 29 Jul 2014 13:48:23 +1000
+Subject: [PATCH] Assemble: Only fail auto-assemble in face of mdadm.conf
+ conflicts.
+
+We should never auto-assemble things that conflict with mdadm.conf
+However explicit assembly requests should be allowed.
+
+Reported-by: olovopb
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1070245
+Signed-off-by: NeilBrown <neilb at suse.de>
+---
+ Assemble.c | 47 ++++++++++++++++++++++++++---------------------
+ 1 file changed, 26 insertions(+), 21 deletions(-)
+
+diff --git a/Assemble.c b/Assemble.c
+index aca28be..cdcdb0f 100644
+--- a/Assemble.c
++++ b/Assemble.c
+@@ -366,9 +366,6 @@ static int select_devices(struct mddev_dev *devlist,
+ 			tmpdev = NULL;
+ 			goto loop;
+ 		} else {
+-			int rv = 0;
+-			struct mddev_ident *match;
+-
+ 			content = *contentp;
+ 			tst->ss->getinfo_super(tst, content, NULL);
+ 
+@@ -377,25 +374,33 @@ static int select_devices(struct mddev_dev *devlist,
+ 					   report_mismatch ? devname : NULL))
+ 				goto loop;
+ 
+-			match = conf_match(tst, content, devname,
+-					   report_mismatch ? c->verbose : -1,
+-					   &rv);
+-			if (!match && rv == 2)
+-				goto loop;
+-			if (match && match->devname &&
+-			    strcasecmp(match->devname, "<ignore>") == 0) {
+-				if (report_mismatch)
+-					pr_err("%s is a member of an explicitly ignored array\n",
+-					       devname);
+-				goto loop;
+-			}
+-			if (match && !ident_matches(match, content, tst,
+-						    c->homehost, c->update,
+-						    report_mismatch ? devname : NULL))
+-				/* Array exists  in mdadm.conf but some
+-				 * details don't match, so reject it
++			if (auto_assem) {
++				/* Never auto-assemble things that conflict
++				 * with mdadm.conf in some way
+ 				 */
+-				goto loop;
++				struct mddev_ident *match;
++				int rv = 0;
++
++				match = conf_match(tst, content, devname,
++						   report_mismatch ? c->verbose : -1,
++						   &rv);
++				if (!match && rv == 2)
++					goto loop;
++				if (match && match->devname &&
++				    strcasecmp(match->devname, "<ignore>") == 0) {
++					if (report_mismatch)
++						pr_err("%s is a member of an explicitly ignored array\n",
++						       devname);
++					goto loop;
++				}
++				if (match && !ident_matches(match, content, tst,
++							    c->homehost, c->update,
++							    report_mismatch ? devname : NULL))
++					/* Array exists  in mdadm.conf but some
++					 * details don't match, so reject it
++					 */
++					goto loop;
++			}
+ 
+ 			/* should be safe to try an exclusive open now, we
+ 			 * have rejected anything that some other mdadm might
+-- 
+1.9.3
+
diff --git a/mdadm-3.3.1-Grow-improve-error-message-is-grow-n2-used-on-Linear.patch b/mdadm-3.3.1-Grow-improve-error-message-is-grow-n2-used-on-Linear.patch
new file mode 100644
index 0000000..e3aeadd
--- /dev/null
+++ b/mdadm-3.3.1-Grow-improve-error-message-is-grow-n2-used-on-Linear.patch
@@ -0,0 +1,38 @@
+From 46643e1ad5ece5f1257b2d827e36231df44929a2 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb at suse.de>
+Date: Tue, 29 Jul 2014 13:37:42 +1000
+Subject: [PATCH] Grow: improve error message is "--grow -n2" used on Linear
+ arrays.
+
+Linear arrays don't respond to setting raid-disks, only to
+adding a device.
+
+Reported-by: mulhern
+Reported-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1122146
+Signed-off-by: NeilBrown <neilb at suse.de>
+---
+ Grow.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Grow.c b/Grow.c
+index af59347..a9c8589 100644
+--- a/Grow.c
++++ b/Grow.c
+@@ -1028,7 +1028,12 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
+ 
+ 	switch (info->array.level) {
+ 	default:
+-		return "Cannot understand this RAID level";
++		return "No reshape is possibly for this RAID level";
++	case LEVEL_LINEAR:
++		if (info->delta_disks != UnSet)
++			return "Only --add is supported for LINEAR, setting --raid-disks is not needed";
++		else
++			return "Only --add is supported for LINEAR, other --grow options are not meaningful";
+ 	case 1:
+ 		/* RAID1 can convert to RAID1 with different disks, or
+ 		 * raid5 with 2 disks, or
+-- 
+1.9.3
+
diff --git a/mdadm.spec b/mdadm.spec
index 222bef4..cf1e686 100644
--- a/mdadm.spec
+++ b/mdadm.spec
@@ -1,7 +1,7 @@
 Summary:     The mdadm program controls Linux md devices (software RAID arrays)
 Name:        mdadm
 Version:     3.3
-Release:     6%{?dist}
+Release:     7%{?dist}
 Source:      http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz
 Source1:     mdmonitor.init
 Source2:     raid-check
@@ -12,6 +12,8 @@ Source6:     mdmonitor.service
 Source7:     mdadm.conf
 Source8:     mdadm_event.conf
 Patch1:      mdadm-3.3-Be-consistent-in-return-types-from-byteswap-macros.patch
+Patch2:      mdadm-3.3.1-Grow-improve-error-message-is-grow-n2-used-on-Linear.patch
+Patch3:      mdadm-3.3.1-Assemble-Only-fail-auto-assemble-in-face-of-mdadm.co.patch
 Patch93:     mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch
 Patch94:     mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch
 Patch95:     mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch
@@ -43,6 +45,8 @@ file can be used to help with some common tasks.
 %setup -q
 
 %patch1 -p1 -b .types
+%patch2 -p1 -b .lineargrow
+%patch3 -p1 -b .autofail
 # Fedora customization patches
 %patch97 -p1 -b .udev
 %patch98 -p1 -b .static
@@ -106,6 +110,12 @@ rm -rf %{buildroot}
 /etc/libreport/events.d/*
 
 %changelog
+* Tue Jul 29 2014 Jes Sorensen <Jes.Sorensen at redhat.com> - 3.3-7
+- Improve error message for "--grow -n2" when used on Linear arrays
+- Fix problem where explicitly specified arrays were not assembled if
+  they were disabled in /etc/mdadm.conf
+- Resolves bz1122146, bz1124310
+
 * Fri Jan 31 2014 Jes Sorensen <Jes.Sorensen at redhat.com> - 3.3-6
 - Revert changes introduced in 3.3-5, they were based on incorrect
   recommendations.


More information about the scm-commits mailing list