aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-03-05 03:30:44 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-05 10:57:53 -0500
commit6d3baf2eb8bd680b2d4f509bc3dbf4dcd6e27a40 (patch)
treebb76dd97b16812efa78f546e08d11bd7ed6eefc7 /drivers/md
parentc6b36e9a3c57b73c7a6bdf787baa55f21195bba9 (diff)
[PATCH] md: fix for raid6 reshape
Recent patch for raid6 reshape had a change missing that showed up in subsequent review. Many places in the raid5 code used "conf->raid_disks-1" to mean "number of data disks". With raid6 that had to be changed to "conf->raid_disk - conf->max_degraded" or similar. One place was missed. This bug means that if a raid6 reshape were aborted in the middle the recorded position would be wrong. On restart it would either fail (as the position wasn't on an appropriate boundary) or would leave a section of the array unreshaped, causing data corruption. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md')
-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 d247429ee5ef..54a1ad5eef42 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3071,7 +3071,7 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
3071 release_stripe(sh); 3071 release_stripe(sh);
3072 } 3072 }
3073 spin_lock_irq(&conf->device_lock); 3073 spin_lock_irq(&conf->device_lock);
3074 conf->expand_progress = (sector_nr + i)*(conf->raid_disks-1); 3074 conf->expand_progress = (sector_nr + i) * new_data_disks;
3075 spin_unlock_irq(&conf->device_lock); 3075 spin_unlock_irq(&conf->device_lock);
3076 /* Ok, those stripe are ready. We can start scheduling 3076 /* Ok, those stripe are ready. We can start scheduling
3077 * reads on the source stripes. 3077 * reads on the source stripes.