From 4347544720e154698dac981292be4d9fea4148ee Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 16 Dec 2010 09:07:52 +1100 Subject: [PATCH] Grow: call start/abort_reshape as appropriate when reshaping a container. This means that ->manage_reshape will be called with reshape ready to roll. Also move the current start_reshape call earlier so that it is before the other ->manage_reshape call. Signed-off-by: NeilBrown --- Grow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Grow.c b/Grow.c index 40b4809a..d77b7f0f 100644 --- a/Grow.c +++ b/Grow.c @@ -756,6 +756,8 @@ static int reshape_container_raid_disks(char *container, int raid_disks) changed++; break; } + if (!rv && level > 1) + start_reshape(sub); sysfs_free(sub); if (rv) break; @@ -823,6 +825,9 @@ static void revert_container_raid_disks(struct supertype *st, int fd, char *cont disks_fixed = 1; } else if (sub) disks_fixed = 1; + + if (sub) + abort_reshape(sub); sysfs_free(sub); if (!disks_fixed || !level_fixed) @@ -1885,6 +1890,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, break; } + start_reshape(sra); if (st->ss->external) { /* metadata handler takes it from here */ ping_manager(container); @@ -1916,6 +1922,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, fprintf(stderr, Name ": %s: Cannot find a superblock\n", devname); rv = 1; + abort_reshape(sra); break; } @@ -1929,7 +1936,6 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, * handling backups of the data... * This is all done by a forked background process. */ - start_reshape(sra); switch(fork()) { case 0: close(fd); -- 2.47.2