Replacement devices are stored at a different offset, so look there too. Signed-off-by: NeilBrown <neilb@xxxxxxx> --- drivers/md/raid1.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 99cd12e..eac9a1d 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1336,6 +1336,9 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev) int number = rdev->raid_disk; struct mirror_info *p = conf->mirrors+ number; + if (rdev != p->rdev) + p = conf->mirrors + conf->raid_disks + number; + print_conf(conf); if (rdev == p->rdev) { if (test_bit(In_sync, &rdev->flags) || @@ -1359,6 +1362,9 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev) err = -EBUSY; p->rdev = rdev; goto abort; + } else { + clear_bit(Replacement, &rdev->flags); + clear_bit(Replaceable, &rdev->flags); } err = md_integrity_register(mddev); } -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html