Switch calculations of read_offset and write_offset

These were backwards...  we read from 'before' and write to 'after'.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-01-11 14:57:14 +11:00
parent b4f8e38b94
commit ec757320c2
1 changed files with 2 additions and 2 deletions

4
Grow.c
View File

@ -2313,8 +2313,8 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape,
* If we need to suspend more, we limit it to 128M per device, which is
* rather arbitrary and should be some time-based calculation.
*/
write_offset = info->reshape_progress / reshape->before.data_disks;
read_offset = info->reshape_progress / reshape->after.data_disks;
read_offset = info->reshape_progress / reshape->before.data_disks;
write_offset = info->reshape_progress / reshape->after.data_disks;
write_range = info->new_chunk/512;
if (advancing) {
if (read_offset < write_offset + write_range) {