[PATCH 1/2] md/raid5: FIX: manually-added spare is not used

[PATCH 1/2] md/raid5: FIX: manually-added spare is not used

am 14.01.2011 13:38:32 von adam.kwolek

Manually added spares are not used due to fact that they not added to md configuration.
Counters are updated only.

Signed-off-by: Adam Kwolek
---

drivers/md/raid5.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a2087c7..b98b01c 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5592,8 +5592,10 @@ static int raid5_start_reshape(mddev_t *mddev)
} else if (rdev->raid_disk >= conf->previous_raid_disks
&& !test_bit(Faulty, &rdev->flags)) {
/* This is a spare that was manually added */
- set_bit(In_sync, &rdev->flags);
- added_devices++;
+ if (raid5_add_disk(mddev, rdev) == 0) {
+ set_bit(In_sync, &rdev->flags);
+ added_devices++;
+ }
}

/* When a reshape changes the number of devices, ->degraded

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html