Commit da7613b8b042ab1d3ea55459ed97301e4a2097bb
1 parent
0c098220e2
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
md/raid5: improve removal of extra devices after reshape.
After a reshape which reduced the number of devices we need to disconnect the extra devices. The code for this doesn't currently handle 'replacement' devices. It is very unlikely that such devices will be present, but it is safest to handle them anyway. So simplify the handling. Just clear In_sync and leave it to remove_and_add_spaces (which will be called soon) to do the real works. Signed-off-by: NeilBrown <neilb@suse.de>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
drivers/md/raid5.c
... | ... | @@ -5755,11 +5755,11 @@ |
5755 | 5755 | d < conf->raid_disks - mddev->delta_disks; |
5756 | 5756 | d++) { |
5757 | 5757 | struct md_rdev *rdev = conf->disks[d].rdev; |
5758 | - if (rdev && | |
5759 | - raid5_remove_disk(mddev, rdev) == 0) { | |
5760 | - sysfs_unlink_rdev(mddev, rdev); | |
5761 | - rdev->raid_disk = -1; | |
5762 | - } | |
5758 | + if (rdev) | |
5759 | + clear_bit(In_sync, &rdev->flags); | |
5760 | + rdev = conf->disks[d].replacement; | |
5761 | + if (rdev) | |
5762 | + clear_bit(In_sync, &rdev->flags); | |
5763 | 5763 | } |
5764 | 5764 | } |
5765 | 5765 | mddev->layout = conf->algorithm; |