From: Adam Kwolek Date: Thu, 9 Feb 2012 01:36:42 +0000 (+1100) Subject: imsm: FIX: use md position to reshape restart X-Git-Tag: mdadm-3.2.4~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a75c8ca79b4cf89a5d1ac24b484b75e8a7e9fb4;p=thirdparty%2Fmdadm.git imsm: FIX: use md position to reshape restart 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 Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index f5762d8e..5f451f31 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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 */