From 71165988bf8e0e76f267b125f3cbeac2242528f7 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Wed, 28 Mar 2012 17:24:12 +0200 Subject: [PATCH] Fix issue when re-adding drive to a raid1 array with bitmap Resolves: bz807743 (f17) bz769323 (f16) bz791159 (f15) Signed-off-by: Jes Sorensen --- ...-fix-adding-devices-with-incremental.patch | 49 +++++++++++++++++++ mdadm.spec | 8 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 mdadm-3.2.3-Incremental-fix-adding-devices-with-incremental.patch diff --git a/mdadm-3.2.3-Incremental-fix-adding-devices-with-incremental.patch b/mdadm-3.2.3-Incremental-fix-adding-devices-with-incremental.patch new file mode 100644 index 0000000..d721dc4 --- /dev/null +++ b/mdadm-3.2.3-Incremental-fix-adding-devices-with-incremental.patch @@ -0,0 +1,49 @@ +From 69fe207ed68e560d76a592fd86af32a9d1deca25 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 22 Mar 2012 15:53:53 +1100 +Subject: [PATCH] Incremental: fix adding devices with --incremental + +We should use 'info' here, not 'info2'. +info2 refers to some other device (There may not even be one).l +info is *this* disk. + +This is particularly important for getting info.disk.state +correct, which the kernel depends on to get 're-add' functionality +correct. + +Signed-off-by: NeilBrown +--- + Incremental.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Incremental.c b/Incremental.c +index 836a6f1..a61f453 100644 +--- a/Incremental.c ++++ b/Incremental.c +@@ -414,19 +414,19 @@ int Incremental(char *devname, int verbose, int runstop, + goto out_unlock; + } + } +- info2.disk.major = major(stb.st_rdev); +- info2.disk.minor = minor(stb.st_rdev); ++ info.disk.major = major(stb.st_rdev); ++ info.disk.minor = minor(stb.st_rdev); + /* add disk needs to know about containers */ + if (st->ss->external) + sra->array.level = LEVEL_CONTAINER; +- err = add_disk(mdfd, st, sra, &info2); ++ err = add_disk(mdfd, st, sra, &info); + if (err < 0 && errno == EBUSY) { + /* could be another device present with the same + * disk.number. Find and reject any such + */ + find_reject(mdfd, st, sra, info.disk.number, + info.events, verbose, chosen_name); +- err = add_disk(mdfd, st, sra, &info2); ++ err = add_disk(mdfd, st, sra, &info); + } + if (err < 0) { + fprintf(stderr, Name ": failed to add %s to %s: %s.\n", +-- +1.7.7.6 + diff --git a/mdadm.spec b/mdadm.spec index 9f9f966..23d4410 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.3 -Release: 6%{?dist} +Release: 7%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2 Source1: mdmonitor.init Source2: raid-check @@ -21,6 +21,7 @@ Patch7: mdadm-3.2.3-Spawn-mdmon-with-offroot-if-mdadm-was-launched-with-.pa Patch8: mdadm-3.2.3-super1-make-aread-awrite-always-use-an-aligned-buffe.patch Patch9: mdadm-3.2.3-avoid-double-free-upon-old-buggy-kernel-sysfs_read-f.patch Patch10: mdadm-3.2.3-Print-error-message-if-failing-to-write-super-for-1..patch +Patch11: mdadm-3.2.3-Incremental-fix-adding-devices-with-incremental.patch Patch19: mdadm-3.2.3-udev.patch Patch20: mdadm-2.5.2-static.patch URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ @@ -65,6 +66,7 @@ is not used as the system init process. %patch8 -p1 -b .bitmap %patch9 -p1 -b .double %patch10 -p1 -b .print +%patch11 -p1 -b .incremental %patch19 -p1 -b .udev %patch20 -p1 -b .static @@ -139,6 +141,10 @@ fi %{_initrddir}/* %changelog +* Wed Mar 28 2012 Jes Sorensen - 3.2.3-7 +- Fix issue when re-adding drive to a raid1 array with bitmap +- Resolves: bz807743 (f17) bz769323 (f16) bz791159 (f15) + * Thu Feb 23 2012 Jes Sorensen - 3.2.3-6 - Fix double free on buggy old kernel sysfs read - Fix segfault if trying to write superblock to non existing device