From: NeilBrown Date: Tue, 11 Jan 2011 03:41:49 +0000 (+1100) Subject: Correctly abort level change when reshape_array fails. X-Git-Tag: mdadm-3.2~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eb48844a5c3f3638c0ff0359c6e1fc9c3debf8f;p=thirdparty%2Fmdadm.git Correctly abort level change when reshape_array fails. We were returning too early. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 611b3e21..f9bc96fe 100644 --- a/Grow.c +++ b/Grow.c @@ -2087,19 +2087,17 @@ static int reshape_array(char *container, int fd, char *devname, release: - if (rv) { - unfreeze(st, frozen); - return rv; - } - if (container) - ping_monitor(container); - if (st->ss->external) { - /* Re-load the metadata as much could have changed */ - int cfd = open_dev(st->container_dev); - if (cfd >= 0) { - st->ss->free_super(st); - st->ss->load_container(st, cfd, container); - close(cfd); + if (!rv) { + if (container) + ping_monitor(container); + if (st->ss->external) { + /* Re-load the metadata as much could have changed */ + int cfd = open_dev(st->container_dev); + if (cfd >= 0) { + st->ss->free_super(st); + st->ss->load_container(st, cfd, container); + close(cfd); + } } } if (rv && orig_level != UnSet && sra) {