Grow: fix crash when restarting an array.

After the 'started' label it is assumed that 'sra' is set, so better
set it when jumping there.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-06-27 13:10:44 +10:00
parent 6a23fb9d0d
commit dfa4d769f0
1 changed files with 10 additions and 0 deletions

10
Grow.c
View File

@ -2835,6 +2835,16 @@ static int reshape_array(char *container, int fd, char *devname,
return 0;
if (restart & RESHAPE_NO_BACKUP)
return 0;
/* Need 'sra' down at 'started:' */
sra = sysfs_read(fd, NULL,
GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|GET_CHUNK|
GET_CACHE);
if (!sra) {
pr_err("%s: Cannot get array details from sysfs\n",
devname);
goto release;
}
goto started;
}
/* The container is frozen but the array may not be.