diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1a19c962f860a6a1af295de57cdb1cc8fc2c6dbb..f4f3edcdaf8d85bbdbd241d8ccb647da2ca8bf54 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) * very different from resync */ return -EBUSY; - if (!enough(conf, -1)) + if (rdev->saved_raid_disk < 0 && !enough(conf, -1)) return -EINVAL; if (rdev->raid_disk >= 0) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 99b2bbf8b5d8a107aea489ad88c2fd94dc16f3f3..d38d235cc39d4999096f92045293989a108ce7db 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) if (mddev->recovery_disabled == conf->recovery_disabled) return -EBUSY; - if (has_failed(conf)) + if (rdev->saved_raid_disk < 0 && has_failed(conf)) /* no point adding a device */ return -EINVAL;