Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5427135 authored by Dan Williams's avatar Dan Williams
Browse files

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: default avatarDan Williams <dan.j.williams@intel.com>
parent df10cfbc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)) {