]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid5: fix calculate of 'degraded' when a replacement becomes active.
authorNeilBrown <neilb@suse.de>
Wed, 19 Sep 2012 02:52:30 +0000 (12:52 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:39:10 +0000 (10:39 -0700)
commit0177d47e166d716789e3fb5b58cfddf451ab8998
tree47ca2a33807e74df7f0b07e7548c0339e7ef571e
parent71a5d69e4007fd336672f052f98730fa383fe49b
md/raid5: fix calculate of 'degraded' when a replacement becomes active.

commit e5c86471f933608db5d43679f84cb4346c32033e upstream.

When a replacement device becomes active, we mark the device that it
replaces as 'faulty' so that it can subsequently get removed.
However 'calc_degraded' only pays attention to the primary device, not
the replacement, so the array appears to become degraded, which is
wrong.

So teach 'calc_degraded' to consider any replacement if a primary
device is faulty.

This is suitable for -stable as an incorrect 'degraded' value can
confuse md and could lead to data corruption.
This is only relevant for 3.3 and later.

Reported-by: Robin Hill <robin@robinhill.me.uk>
Reported-by: John Drescher <drescherjm@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid5.c