Fix issue when re-adding drive to a raid1 array with bitmap

Resolves: bz807743 (f17) bz769323 (f16) bz791159 (f15)

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Jes Sorensen 2012-03-28 17:24:12 +02:00
parent e2bea3e210
commit 71165988bf
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,49 @@
From 69fe207ed68e560d76a592fd86af32a9d1deca25 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
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 <neilb@suse.de>
---
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

View File

@ -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 <Jes.Sorensen@redhat.com> - 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 <Jes.Sorensen@redhat.com> - 3.2.3-6
- Fix double free on buggy old kernel sysfs read
- Fix segfault if trying to write superblock to non existing device