aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-08-12 20:41:49 -0400
committerNeilBrown <neilb@suse.de>2009-08-12 20:41:49 -0400
commit1a67dde0abba36421a1257d01ba9de2f6d1c160a (patch)
treec182c31207c46824097be7ce6b8813f05db4eb65
parenta639755cf885e437b2fe4168d35157fa90d530ab (diff)
md/raid5: Properly remove excess drives after shrinking a raid5/6
We were removing the drives, from the array, but not removing symlinks from /sys/.... and not marking the device as having been removed. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/raid5.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 94a74cb5cccb..b8a2c5dc67ba 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5097,8 +5097,15 @@ static void raid5_finish_reshape(mddev_t *mddev)
5097 mddev->degraded--; 5097 mddev->degraded--;
5098 for (d = conf->raid_disks ; 5098 for (d = conf->raid_disks ;
5099 d < conf->raid_disks - mddev->delta_disks; 5099 d < conf->raid_disks - mddev->delta_disks;
5100 d++) 5100 d++) {
5101 raid5_remove_disk(mddev, d); 5101 mdk_rdev_t *rdev = conf->disks[d].rdev;
5102 if (rdev && raid5_remove_disk(mddev, d) == 0) {
5103 char nm[20];
5104 sprintf(nm, "rd%d", rdev->raid_disk);
5105 sysfs_remove_link(&mddev->kobj, nm);
5106 rdev->raid_disk = -1;
5107 }
5108 }
5102 } 5109 }
5103 mddev->layout = conf->algorithm; 5110 mddev->layout = conf->algorithm;
5104 mddev->chunk_sectors = conf->chunk_sectors; 5111 mddev->chunk_sectors = conf->chunk_sectors;