diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-07-29 10:28:06 +0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-07-29 04:52:44 +0400 |
commit | e542713529e323ff09d7aeb5806cf29f6f160f53 (patch) | |
tree | 751dffc2043342eb6f76b0c37a07a698462b5516 | |
parent | df10cfbc4d7ab93260d997df754219d390d62a9d (diff) | |
download | linux-e542713529e323ff09d7aeb5806cf29f6f160f53.tar.xz |
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>
-rw-r--r-- | drivers/md/md.c | 3 |
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) 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)) { |