summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-10-31 11:42:03 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-05 09:50:41 +0100
commit32f25ea28ad28fbb4080d0b7a279279c7e21b1d0 (patch)
treefc11456cdcda18f81d4534b26dd2e0549f41c70e /drivers
parente7355f1112773a015e914b4f815460b7bbe88954 (diff)
downloadlinux-3.10-32f25ea28ad28fbb4080d0b7a279279c7e21b1d0.tar.gz
linux-3.10-32f25ea28ad28fbb4080d0b7a279279c7e21b1d0.tar.bz2
linux-3.10-32f25ea28ad28fbb4080d0b7a279279c7e21b1d0.zip
md/raid1: Fix assembling of arrays containing Replacements.
commit 02b898f2f04e418094f0093a3ad0b415bcdbe8eb upstream. setup_conf in raid1.c uses conf->raid_disks before assigning a value. It is used when including 'Replacement' devices. The consequence is that assembling an array which contains a replacement will misbehave and either not include the replacement, or not include the device being replaced. Though this doesn't lead directly to data corruption, it could lead to reduced data safety. So use mddev->raid_disks, which is initialised, instead. Bug was introduced by commit c19d57980b38a5bb613a898937a1cf85f422fb9b md/raid1: recognise replacements when assembling arrays. in 3.3, so fix is suitable for 3.3.y thru 3.6.y. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/raid1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 23904d23373..df445091384 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2564,7 +2564,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
|| disk_idx < 0)
continue;
if (test_bit(Replacement, &rdev->flags))
- disk = conf->mirrors + conf->raid_disks + disk_idx;
+ disk = conf->mirrors + mddev->raid_disks + disk_idx;
else
disk = conf->mirrors + disk_idx;