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: upstream/snapshot3+hdmi~23173^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e542713529e323ff09d7aeb5806cf29f6f160f53;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.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 0f1b830..c7aae66 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)) {