aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-07-04 02:38:16 -0400
committerNeilBrown <neilb@suse.de>2013-07-04 02:42:52 -0400
commitfdcfbbb653b27964c4daa4d2bcb364259c257e7d (patch)
tree1ea7bffe6fbd61874922fb9da20c0a9157a9d71c /drivers/md/raid5.c
parent78eaa0d4cbcdb345992fa3dd22b3bcbb473cc064 (diff)
md/raid5: allow 5-device RAID6 to be reshaped to 4-device.
There is a bug in 'check_reshape' for raid5.c To checks that the new minimum number of devices is large enough (which is good), but it does so also after the reshape has started (bad). This is bad because - the calculation is now wrong as mddev->raid_disks has changed already, and - it is pointless because it is now too late to stop. So only perform that test when reshape has not been committed to. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index cd9aab9329fd..2bf094a587cb 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5914,7 +5914,7 @@ static int check_reshape(struct mddev *mddev)
5914 return 0; /* nothing to do */ 5914 return 0; /* nothing to do */
5915 if (has_failed(conf)) 5915 if (has_failed(conf))
5916 return -EINVAL; 5916 return -EINVAL;
5917 if (mddev->delta_disks < 0) { 5917 if (mddev->delta_disks < 0 && mddev->reshape_position == MaxSector) {
5918 /* We might be able to shrink, but the devices must 5918 /* We might be able to shrink, but the devices must
5919 * be made bigger first. 5919 * be made bigger first.
5920 * For raid6, 4 is the minimum size. 5920 * For raid6, 4 is the minimum size.