]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: initalize reshape progress as it is stored in metatdata
authorAdam Kwolek <adam.kwolek@intel.com>
Tue, 22 Feb 2011 14:13:23 +0000 (15:13 +0100)
committerNeilBrown <neilb@suse.de>
Wed, 23 Feb 2011 03:16:37 +0000 (14:16 +1100)
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 <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index e8d2c6ba5538d7b42c64085476efd5e008a55644..1b3407ae1e06ea4b9099346f92cbd03155fd395a 100644 (file)
@@ -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: