aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-03-18 21:46:37 -0400
committerNeilBrown <neilb@suse.de>2012-03-18 21:46:37 -0400
commitdc10c643e8a8d008fd16dd6706e9e0018eadf8d2 (patch)
tree6a0efe323cfaca9d180c0429c74697598c6d9a05 /drivers/md
parent41fe75f60bcd4d698daed3e54bb099227358ce58 (diff)
md: allow re-add to failed arrays.
When an array is failed (some data inaccessible) then there is no point attempting to add a spare as it could not possibly be recovered. However that may be value in re-adding a recently removed device. e.g. if there is a write-intent-bitmap and it is clear, then access to the data could be restored by this action. So don't reject a re-add to a failed array for RAID10 and RAID5 (the only arrays types that check for a failed array). Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid10.c2
-rw-r--r--drivers/md/raid5.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 1a19c962f860..f4f3edcdaf8d 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1483,7 +1483,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1483 * very different from resync 1483 * very different from resync
1484 */ 1484 */
1485 return -EBUSY; 1485 return -EBUSY;
1486 if (!enough(conf, -1)) 1486 if (rdev->saved_raid_disk < 0 && !enough(conf, -1))
1487 return -EINVAL; 1487 return -EINVAL;
1488 1488
1489 if (rdev->raid_disk >= 0) 1489 if (rdev->raid_disk >= 0)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 99b2bbf8b5d8..d38d235cc39d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5361,7 +5361,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
5361 if (mddev->recovery_disabled == conf->recovery_disabled) 5361 if (mddev->recovery_disabled == conf->recovery_disabled)
5362 return -EBUSY; 5362 return -EBUSY;
5363 5363
5364 if (has_failed(conf)) 5364 if (rdev->saved_raid_disk < 0 && has_failed(conf))
5365 /* no point adding a device */ 5365 /* no point adding a device */
5366 return -EINVAL; 5366 return -EINVAL;
5367 5367