imsm: FIX: put expansion finalization in to one place
When a->last_checkpoint variable can reach array end, reshape finalization can be put in to single place. There is no need to reset migration variables. imsm_set_disk() will call end_migration() and this sets all migration variables to required values. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
02eedb57aa
commit
e154ced310
|
@ -5174,10 +5174,7 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
|
|||
if (a->last_checkpoint >= a->info.component_size) {
|
||||
unsigned long long array_blocks;
|
||||
int used_disks;
|
||||
/* it seems the reshape is all done */
|
||||
dev->vol.migr_state = 0;
|
||||
dev->vol.migr_type = 0;
|
||||
dev->vol.curr_migr_unit = 0;
|
||||
struct mdinfo *mdi;
|
||||
|
||||
used_disks = imsm_num_data_members(dev, -1);
|
||||
array_blocks = map->blocks_per_member * used_disks;
|
||||
|
@ -5191,8 +5188,15 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
|
|||
* array size
|
||||
*/
|
||||
super->updates_pending++;
|
||||
|
||||
/* finalize online capacity expansion/reshape */
|
||||
for (mdi = a->info.devs; mdi; mdi = mdi->next)
|
||||
imsm_set_disk(a,
|
||||
mdi->disk.raid_disk,
|
||||
mdi->curr_state);
|
||||
|
||||
imsm_progress_container_reshape(super);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5257,19 +5261,6 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
|
|||
super->updates_pending++;
|
||||
}
|
||||
|
||||
/* manage online capacity expansion/reshape */
|
||||
if ((a->curr_action != reshape) &&
|
||||
(a->prev_action == reshape)) {
|
||||
struct mdinfo *mdi;
|
||||
|
||||
/* finalize online capacity expansion/reshape */
|
||||
for (mdi = a->info.devs; mdi; mdi = mdi->next)
|
||||
imsm_set_disk(a, mdi->disk.raid_disk, mdi->curr_state);
|
||||
|
||||
/* check next volume reshape */
|
||||
imsm_progress_container_reshape(super);
|
||||
}
|
||||
|
||||
return consistent;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue