aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-07-29 02:28:06 -0400
committerDan Williams <dan.j.williams@intel.com>2008-07-28 20:52:44 -0400
commite542713529e323ff09d7aeb5806cf29f6f160f53 (patch)
tree751dffc2043342eb6f76b0c37a07a698462b5516 /drivers/md/md.c
parentdf10cfbc4d7ab93260d997df754219d390d62a9d (diff)
md: do not count blocked devices as spares
remove_and_add_spares() assumes that failed devices have been hot-removed from the array. Removal is skipped in the 'blocked' case so do not count a device in this state as 'spare'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0f1b83096425..c7aae66c6f9b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5996,7 +5996,8 @@ static int remove_and_add_spares(mddev_t *mddev)
5996 if (mddev->degraded) { 5996 if (mddev->degraded) {
5997 rdev_for_each(rdev, rtmp, mddev) { 5997 rdev_for_each(rdev, rtmp, mddev) {
5998 if (rdev->raid_disk >= 0 && 5998 if (rdev->raid_disk >= 0 &&
5999 !test_bit(In_sync, &rdev->flags)) 5999 !test_bit(In_sync, &rdev->flags) &&
6000 !test_bit(Blocked, &rdev->flags))
6000 spares++; 6001 spares++;
6001 if (rdev->raid_disk < 0 6002 if (rdev->raid_disk < 0
6002 && !test_bit(Faulty, &rdev->flags)) { 6003 && !test_bit(Faulty, &rdev->flags)) {