]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: restart reshape when reshape process is stopped just between 2 reshapes
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 9 Feb 2012 01:37:40 +0000 (12:37 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 9 Feb 2012 01:37:40 +0000 (12:37 +1100)
When reshape is restarted from '0', very begin of array
it is possible that for external metadata reshape and array
configuration doesn't happen.
Check if md has the same opinion, and reshape is restarted
from 0. If so, this is regular reshape start after reshape
switch in metadata to next array only.

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

diff --git a/Grow.c b/Grow.c
index 6b1380a2fbdc00381fe9590ebf48f21f80c5f01d..61adefa55f6c3f8b3252dc53e75ac8ef1e6b59af 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1980,6 +1980,18 @@ static int reshape_array(char *container, int fd, char *devname,
                goto release;
        }
 
+       if (st->ss->external && restart && (info->reshape_progress == 0)) {
+               /* When reshape is restarted from '0', very begin of array
+                * it is possible that for external metadata reshape and array
+                * configuration doesn't happen.
+                * Check if md has the same opinion, and reshape is restarted
+                * from 0. If so, this is regular reshape start after reshape
+                * switch in metadata to next array only.
+                */
+               if ((verify_reshape_position(info, reshape.level) >= 0) &&
+                   (info->reshape_progress == 0))
+                       restart = 0;
+       }
        if (restart) {
                /* reshape already started. just skip to monitoring the reshape */
                if (reshape.backup_blocks == 0)