From: Adam Kwolek Date: Tue, 22 Feb 2011 14:13:23 +0000 (+0100) Subject: imsm: FIX: initalize reshape progress as it is stored in metatdata X-Git-Tag: mdadm-3.2.1~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2e6d5d65b49021e02af282191f46ae385f2cd23;p=thirdparty%2Fmdadm.git imsm: FIX: initalize reshape progress as it is stored in metatdata reshape prodess cannot be restarted due to no checkpoint information in mdinfo. When metadata is read during reshape process or reshape restart, rehape_progress (mdinfo field) has to be initialized to value stored in metadata. This allows start reshape from stored in metadata checkpoint. Signed-off-by: Adam Kwolek Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index e8d2c6ba..1b3407ae 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1784,6 +1784,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, else info->delta_disks = 0; + info->reshape_progress = 0; if (map_to_analyse->map_state == IMSM_T_STATE_UNINITIALIZED || dev->vol.dirty) { info->resync_start = 0; @@ -1797,6 +1798,15 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, info->resync_start = blocks_per_unit * units; break; } + case MIGR_GEN_MIGR: { + __u64 blocks_per_unit = blocks_per_migr_unit(dev); + __u64 units = __le32_to_cpu(dev->vol.curr_migr_unit); + + info->reshape_progress = blocks_per_unit * units; + dprintf("IMSM: General Migration checkpoint : %llu " + "(%llu) -> read reshape progress : %llu\n", + units, blocks_per_unit, info->reshape_progress); + } case MIGR_VERIFY: /* we could emulate the checkpointing of * 'sync_action=check' migrations, but for now @@ -1804,7 +1814,6 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, */ case MIGR_REBUILD: /* this is handled by container_content_imsm() */ - case MIGR_GEN_MIGR: case MIGR_STATE_CHANGE: /* FIXME handle other migrations */ default: