md/raid10: fix "enough" function for detecting if array is failed.
commit4e19de3be14c9390e63271effb5b95ab50f298f4
authorNeilBrown <neilb@suse.de>
Thu, 27 Sep 2012 02:35:21 +0000 (27 12:35 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Oct 2012 02:31:06 +0000 (10 03:31 +0100)
treeb1183503455bedd80f21eb5e6dcaa3cdc2eb271d
parente3dd7a09f14902688ae99eb8f3a49e3651147283
md/raid10: fix "enough" function for detecting if array is failed.

commit 80b4812407c6b1f66a4f2430e69747a13f010839 upstream.

The 'enough' function is written to work with 'near' arrays only
in that is implicitly assumes that the offset from one 'group' of
devices to the next is the same as the number of copies.
In reality it is the number of 'near' copies.

So change it to make this number explicit.

This bug makes it possible to run arrays without enough drives
present, which is dangerous.
It is appropriate for an -stable kernel, but will almost certainly
need to be modified for some of them.

Reported-by: Jakub Husák <jakub@gooseman.cz>
Signed-off-by: NeilBrown <neilb@suse.de>
[bwh: Backported to 3.2: s/geo->/conf->/]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/raid10.c