FIX: Container can be left frozen

When container operation fails before child process starts,
array can be left frozen because container_reshape() doesn't make
unfreeze() operation in all error cases, as it is responsible for.

add unfreeze() operation for error case scenarios in reshape_container()

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-02-09 14:07:26 +11:00 committed by NeilBrown
parent 8200f09e8f
commit 9e3254422d
1 changed files with 4 additions and 1 deletions

5
Grow.c
View File

@ -2122,8 +2122,10 @@ int reshape_container(char *container, int cfd, char *devname,
if (reshape_super(st, -1, info->new_level,
info->new_layout, info->new_chunk,
info->array.raid_disks + info->delta_disks,
backup_file, devname, quiet))
backup_file, devname, quiet)) {
unfreeze(st);
return 1;
}
sync_metadata(st);
@ -2134,6 +2136,7 @@ int reshape_container(char *container, int cfd, char *devname,
switch (fork()) {
case -1: /* error */
perror("Cannot fork to complete reshape\n");
unfreeze(st);
return 1;
default: /* parent */
printf(Name ": multi-array reshape continues in background\n");