md/raid10: Don't try to recovery unmatched (and unused) chunks.
authorNeilBrown <neilb@suse.de>
Tue, 3 Jul 2012 00:37:30 +0000 (10:37 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 16:04:25 +0000 (09:04 -0700)
commit04e0f69d135f6cf10534282fc09cf3efd6973c5b
treea5d1d20670b6c24a78112446f51009aee13ed267
parent10ff23ae117665e886fed089cb5a2e015cd8b7b4
md/raid10: Don't try to recovery unmatched (and unused) chunks.

commit fc448a18ae6219af9a73257b1fbcd009efab4a81 upstream.

If a RAID10 has an odd number of chunks - as might happen when there
are an odd number of devices - the last chunk has no pair and so is
not mirrored.  We don't store data there, but when recovering the last
device in an array we retry to recover that last chunk from a
non-existent location.  This results in an error, and the recovery
aborts.

When we get to that last chunk we should just stop - there is nothing
more to do anyway.

This bug has been present since the introduction of RAID10, so the
patch is appropriate for any -stable kernel.

Reported-by: Christian Balzer <chibi@gol.com>
Tested-by: Christian Balzer <chibi@gol.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid10.c