diff options
author | Adam Kwolek <adam.kwolek@intel.com> | 2011-06-09 13:00:55 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-09 13:00:55 +1000 |
commit | 0228d92ca3bf1b6a8b2d6d5aef9bb64d82d103fe (patch) | |
tree | 8a80e5cf58cc9b9cf4a7530cc63fa61bdb375a1b | |
parent | 2e062e82102a5ee6c430e036a59071b9f1a5c475 (diff) |
imsm: FIX: Detect migration end during migration record saving
Checkpoint should be saved when migration is in progress only.
End of reshape (based on passes status) should be detected and it should
not cause abort of reshape/check-pointing/ operation.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | super-intel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c index ad5e79c6..974e7448 100644 --- a/super-intel.c +++ b/super-intel.c @@ -7759,6 +7759,8 @@ abort: * Returns: * 0: success * 1: failure + * 2: failure, means no valid migration record + * / no general migration in progress / ******************************************************************************/ int save_checkpoint_imsm(struct supertype *st, struct mdinfo *info, int state) { @@ -7770,8 +7772,8 @@ int save_checkpoint_imsm(struct supertype *st, struct mdinfo *info, int state) } if (__le32_to_cpu(super->migr_rec->blocks_per_unit) == 0) { - dprintf("ERROR: blocks_per_unit = 0!!!\n"); - return 1; + dprintf("imsm: no migration in progress.\n"); + return 2; } super->migr_rec->curr_migr_unit = @@ -8841,7 +8843,9 @@ static int imsm_manage_reshape( sra->reshape_progress = next_step; - if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL)) { + if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL) == 1) { + /* ignore error == 2, this can mean end of reshape here + */ dprintf("imsm: Cannot write checkpoint to " "migration record (UNIT_SRC_NORMAL)\n"); goto abort; |