diff options
-rw-r--r-- | 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 e7768e37f36a..3d9aa0c92821 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) | |||
1336 | int number = rdev->raid_disk; | 1336 | int number = rdev->raid_disk; |
1337 | struct mirror_info *p = conf->mirrors+ number; | 1337 | struct mirror_info *p = conf->mirrors+ number; |
1338 | 1338 | ||
1339 | if (rdev != p->rdev) | ||
1340 | p = conf->mirrors + conf->raid_disks + number; | ||
1341 | |||
1339 | print_conf(conf); | 1342 | print_conf(conf); |
1340 | if (rdev == p->rdev) { | 1343 | if (rdev == p->rdev) { |
1341 | if (test_bit(In_sync, &rdev->flags) || | 1344 | if (test_bit(In_sync, &rdev->flags) || |
@@ -1359,6 +1362,9 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev) | |||
1359 | err = -EBUSY; | 1362 | err = -EBUSY; |
1360 | p->rdev = rdev; | 1363 | p->rdev = rdev; |
1361 | goto abort; | 1364 | goto abort; |
1365 | } else { | ||
1366 | clear_bit(Replacement, &rdev->flags); | ||
1367 | clear_bit(WantReplacement, &rdev->flags); | ||
1362 | } | 1368 | } |
1363 | err = md_integrity_register(mddev); | 1369 | err = md_integrity_register(mddev); |
1364 | } | 1370 | } |