]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix issues with the finish of monitoring a reshape.
authorNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 23:40:56 +0000 (10:40 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 23:40:56 +0000 (10:40 +1100)
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 <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 9e9738cf5d82c66430554d6ca0677e2f02a8da0b..03a81e50ab533b8994d704976cba4494c3eb2661 100644 (file)
--- 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);