]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Do not try to (continue) reshape using inactive array
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 9 Feb 2012 01:38:15 +0000 (12:38 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 9 Feb 2012 01:38:15 +0000 (12:38 +1100)
When one of arrays is inactive, do not try to continue reshape
on this array. Just skip it.

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 61adefa55f6c3f8b3252dc53e75ac8ef1e6b59af..53a7cad72aca4256fda8a61efdf69adfba7c3b30 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -2626,6 +2626,13 @@ int reshape_container(char *container, char *devname,
                                                  devname2devnum(container));
                        if (!mdstat)
                                continue;
+                       if (mdstat->active == 0) {
+                               fprintf(stderr, Name ": Skipping inactive "
+                                       "array md%i.\n", mdstat->devnum);
+                               free_mdstat(mdstat);
+                               mdstat = NULL;
+                               continue;
+                       }
                        break;
                }
                if (!content)
@@ -3922,6 +3929,13 @@ int Grow_continue_command(char *devname, int fd,
                        mdstat = mdstat_by_subdev(array, container_dev);
                        if (!mdstat)
                                continue;
+                       if (mdstat->active == 0) {
+                               fprintf(stderr, Name ": Skipping inactive "
+                                       "array md%i.\n", mdstat->devnum);
+                               free_mdstat(mdstat);
+                               mdstat = NULL;
+                               continue;
+                       }
                        break;
                }
                if (!content) {