]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: use md position to reshape restart
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 9 Feb 2012 01:36:42 +0000 (12:36 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 9 Feb 2012 01:36:42 +0000 (12:36 +1100)
When reshape is broken it can occur that metadata is not saved properly.
This can cause that reshape process is farther in md than metadata states.

On restart save checkpoint to store current position /probably farther/
that can be read from md.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index f5762d8eac63a4c6357c5ca14c18f823705d7e08..5f451f319b4322cf86189da71e7bebcb5ad0501e 100644 (file)
@@ -10067,6 +10067,18 @@ static int imsm_manage_reshape(
                                "are present in copy area.\n");
                        goto abort;
                }
+               /* Save checkpoint to update migration record for current
+                * reshape position (in md). It can be farther than current
+                * reshape position in metadata.
+                */
+               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, "
+                               "initial save)\n");
+                       goto abort;
+               }
        }
 
        /* size for data */