Replacement devices are stored at a different offset, so look
there too.
Signed-off-by: NeilBrown <neilb@suse.de>
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) ||
err = -EBUSY;
p->rdev = rdev;
goto abort;
+ } else {
+ clear_bit(Replacement, &rdev->flags);
+ clear_bit(WantReplacement, &rdev->flags);
}
err = md_integrity_register(mddev);
}