From c6a442ba3ed89f318d0be36da50611ee80ae8b58 Mon Sep 17 00:00:00 2001 From: Doug Ledford Date: Wed, 31 Aug 2011 15:53:51 -0400 Subject: [PATCH] Fix failed boot Older imsm arrays, or arrays created by something other than mdadm, might have one of two unused bits in the attributes field set. If they do, we need to ignore them, not fail to assemble the array. Signed-off-by: Doug Ledford (cherry picked from commit 22ef59a98600f5900f957e2a0bdc16139aa528da) --- mdadm-3.2.2-attributes.patch | 41 ++++++++++++++++++++++++++++++++++++ mdadm.spec | 8 ++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 mdadm-3.2.2-attributes.patch diff --git a/mdadm-3.2.2-attributes.patch b/mdadm-3.2.2-attributes.patch new file mode 100644 index 0000000..9fb41c0 --- /dev/null +++ b/mdadm-3.2.2-attributes.patch @@ -0,0 +1,41 @@ +diff -up mdadm-3.2.2/super-intel.c.attributes mdadm-3.2.2/super-intel.c +--- mdadm-3.2.2/super-intel.c.attributes 2011-08-31 15:50:02.919229255 -0400 ++++ mdadm-3.2.2/super-intel.c 2011-08-31 15:51:58.560231484 -0400 +@@ -74,14 +74,18 @@ + + /* Define all supported attributes that have to be accepted by mdadm + */ +-#define MPB_ATTRIB_SUPPORTED MPB_ATTRIB_CHECKSUM_VERIFY | \ ++#define MPB_ATTRIB_SUPPORTED (MPB_ATTRIB_CHECKSUM_VERIFY | \ + MPB_ATTRIB_2TB | \ + MPB_ATTRIB_2TB_DISK | \ + MPB_ATTRIB_RAID0 | \ + MPB_ATTRIB_RAID1 | \ + MPB_ATTRIB_RAID10 | \ + MPB_ATTRIB_RAID5 | \ +- MPB_ATTRIB_EXP_STRIPE_SIZE ++ MPB_ATTRIB_EXP_STRIPE_SIZE) ++ ++/* Define attributes that are unused but not harmful */ ++#define MPB_ATTRIB_IGNORED (MPB_ATTRIB_NEVER_USE | \ ++ MPB_ATTRIB_NEVER_USE2) + + #define MPB_SECTOR_CNT 2210 + #define IMSM_RESERVED_SECTORS 4096 +@@ -1141,11 +1145,14 @@ void examine_migr_rec_imsm(struct intel_ + static int imsm_check_attributes(__u32 attributes) + { + int ret_val = 1; +- __u32 not_supported = (MPB_ATTRIB_SUPPORTED)^0xffffffff; ++ __u32 not_supported = MPB_ATTRIB_SUPPORTED^0xffffffff; ++ ++ not_supported &= ~MPB_ATTRIB_IGNORED; + + not_supported &= attributes; + if (not_supported) { +- fprintf(stderr, Name "(IMSM): Unsupported attributes : %x\n", not_supported); ++ fprintf(stderr, Name "(IMSM): Unsupported attributes : %x\n", ++ (unsigned)__le32_to_cpu(not_supported)); + if (not_supported & MPB_ATTRIB_CHECKSUM_VERIFY) { + dprintf("\t\tMPB_ATTRIB_CHECKSUM_VERIFY \n"); + not_supported ^= MPB_ATTRIB_CHECKSUM_VERIFY; diff --git a/mdadm.spec b/mdadm.spec index f13ca2e..2a146af 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.2.2 -Release: 8%{?dist} +Release: 9%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2 Source1: mdmonitor.init Source2: raid-check @@ -16,6 +16,7 @@ Patch1: mdadm-3.2.1-version.patch Patch2: mdadm-3.2.2-fixbuild.patch Patch3: mdadm-3.2.2-readd.patch Patch4: mdadm-3.2.2-writemostly.patch +Patch5: mdadm-3.2.2-attributes.patch Patch19: mdadm-3.1.3-udev.patch Patch20: mdadm-2.5.2-static.patch URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ @@ -55,6 +56,7 @@ is not used as the system init process. %patch2 -p1 -b .build %patch3 -p1 -b .readd %patch4 -p1 -b .writemostly +%patch5 -p1 -b .attributes %patch19 -p1 -b .udev %patch20 -p1 -b .static @@ -129,6 +131,10 @@ fi %{_initrddir}/* %changelog +* Wed Aug 31 2011 Doug Ledford - 3.2.2-9 +- Fix boot with older imsm arrays that have an unused attribute set +- Resolves: bz729205 + * Thu Aug 25 2011 Doug Ledford - 3.2.2-8 - Rework the 65-md-incremental.rules file to add the following support: Nested md raid arrays should now work