]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Load container content for container reshape continuation
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 9 Mar 2011 22:54:56 +0000 (09:54 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 9 Mar 2011 22:54:56 +0000 (09:54 +1100)
st->sb is null. This is exception cause.
reshape_container() function expects that super block will be loaded.

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 40cb929191cd65b3bd8fd8fcdca2c4ce6570fe4d..5acd94dee0b350bfe7525879c8b74bb4190a2917 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -3370,10 +3370,17 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
                fmt_devname(buf, st->container_dev);
                container = buf;
                freeze(st);
-               if (info->reshape_active == 2)
+
+               if (info->reshape_active == 2) {
+                       int cfd = open_dev(st->container_dev);
+                       if (cfd < 0)
+                               return 1;
+                       st->ss->load_container(st, cfd, container);
+                       close(cfd);
                        return reshape_container(container, NULL,
                                                 st, info, 0, backup_file,
                                                 0, 1);
+               }
        }
        return reshape_array(container, mdfd, "array", st, info, 1,
                             backup_file, 0, 0, 1);