From: NeilBrown Date: Tue, 11 Jan 2011 23:40:56 +0000 (+1100) Subject: Fix issues with the finish of monitoring a reshape. X-Git-Tag: mdadm-3.2~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=223c5c999ef9942e16455885f37752d0991f582f;p=thirdparty%2Fmdadm.git Fix issues with the finish of monitoring a reshape. 1/ We need to clean up the backup file after the reshape finishes. 2/ We need to remove the suspended region and clear the resync controls after the resync finishes. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 9e9738cf..03a81e50 100644 --- a/Grow.c +++ b/Grow.c @@ -2795,11 +2795,6 @@ static int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, rv = progress_reshape(sra, reshape, backup_point, wait_point, &suspend_point, &reshape_completed); - if (rv < 0) { - done = 1; - break; - } - /* external metadata would need to ping_monitor here */ sra->reshape_progress = reshape_completed; @@ -2822,6 +2817,11 @@ static int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, destoffsets, 1); } + if (rv < 0) { + done = 1; + break; + } + if (rv) { unsigned long long offset; /* need to backup some space... */ @@ -2849,6 +2849,8 @@ static int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, } } + /* FIXME maybe call progress_reshape one more time instead */ + abort_reshape(sra); /* remove any remaining suspension */ if (reshape->before.data_disks == reshape->after.data_disks) sysfs_set_num(sra, NULL, "sync_speed_min", speed); free(buf);