]> git.baikalelectronics.ru Git - kernel.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)
committerNeilBrown <neilb@suse.de>
Wed, 19 Sep 2012 02:52:30 +0000 (12:52 +1000)
commit906dc5203514e7f78bf5ed8dd397fbc24afc01c8
treee596b35a134b9cc4e308f90090ecf9998a5b58a4
parentcb4ca15ccf6e56766e30571230a24fc41dffa1eb
md/raid5: fix calculate of 'degraded' when a replacement becomes active.

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.

Cc: stable@vger.kernel.org
Reported-by: Robin Hill <robin@robinhill.me.uk>
Reported-by: John Drescher <drescherjm@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c