]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: goto release if Manage_subdevs failed
authorGuoqing Jiang <gqjiang@suse.com>
Tue, 22 Mar 2016 09:03:44 +0000 (17:03 +0800)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 22 Mar 2016 17:53:10 +0000 (13:53 -0400)
If failure happened when add disk to array
by grow mode, need to goto release instead
of continue the reshape.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index 3204135bed303e76bee321d2481d0eb925cb52fc..5953db2d96f29f9322cbaaa8fa094e01ac178f21 100755 (executable)
--- a/Grow.c
+++ b/Grow.c
@@ -3009,9 +3009,11 @@ static int reshape_array(char *container, int fd, char *devname,
         * array.  Now that the array has been changed to the right
         * level and frozen, we can safely add them.
         */
-       if (devlist)
-               Manage_subdevs(devname, fd, devlist, verbose,
-                              0,NULL, 0);
+       if (devlist) {
+               if (Manage_subdevs(devname, fd, devlist, verbose,
+                                  0, NULL, 0))
+                       goto release;
+       }
 
        if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS)
                reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;