aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-22 18:17:56 -0500
committerNeilBrown <neilb@suse.de>2011-12-22 18:17:56 -0500
commitb014f14c81bc5db4e40e2a4db10998fd79c1c64c (patch)
tree78c5499e8af9a3e850ca2f93d215c53d55c40003 /drivers/md/raid1.c
parent8f19ccb2fd70deb1f278be5e75076074cfddee46 (diff)
md/raid1: Allow a failed replacement device to be removed.
Replacement devices are stored at a different offset, so look there too. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c6
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 }