diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-07-28 23:28:06 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-07-28 17:52:44 -0700 |
commit | e542713529e323ff09d7aeb5806cf29f6f160f53 (patch) | |
tree | 751dffc2043342eb6f76b0c37a07a698462b5516 /drivers/md | |
parent | df10cfbc4d7ab93260d997df754219d390d62a9d (diff) | |
download | linux-e542713529e323ff09d7aeb5806cf29f6f160f53.tar.bz2 |
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')
-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)) { |