]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid1: Fix assembling of arrays containing Replacements.
authorNeilBrown <neilb@suse.de>
Wed, 31 Oct 2012 00:42:03 +0000 (11:42 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 08:56:49 +0000 (09:56 +0100)
commit636b755668eefd3537af58e7843ef8389c4d03b6
treef921a16fb7ef59a16a958d146b9af4970fca8989
parent4b4717878e2e70626855d5a6b4639a8e37599acc
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>
drivers/md/raid1.c