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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2010-12-16 09:07:52 +11:00
parent d18bfbe3d0
commit 4347544720
1 changed files with 7 additions and 1 deletions

8
Grow.c
View File

@ -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);