From: Dan Williams Date: Tue, 29 Jul 2008 06:28:06 +0000 (-0700) Subject: md: do not count blocked devices as spares X-Git-Tag: v2.6.27-rc2~95^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e542713529e323ff09d7aeb5806cf29f6f160f53;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 0f1b8309642..c7aae66c6f9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5996,7 +5996,8 @@ static int remove_and_add_spares(mddev_t *mddev) if (mddev->degraded) { rdev_for_each(rdev, rtmp, mddev) { if (rdev->raid_disk >= 0 && - !test_bit(In_sync, &rdev->flags)) + !test_bit(In_sync, &rdev->flags) && + !test_bit(Blocked, &rdev->flags)) spares++; if (rdev->raid_disk < 0 && !test_bit(Faulty, &rdev->flags)) {