summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-06-27 13:10:44 +1000
committerNeilBrown <neilb@suse.de>2013-06-27 13:10:44 +1000
commitdfa4d769f0bd3b8a603636afec2a4f7c5173b0a8 (patch)
tree31407a67f5d669979750d9278b134fad0c6b6069 /Grow.c
parent6a23fb9d0d21e8fc7cb37f60e988c73ff31458e0 (diff)
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>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index 8e4594d6..1d0c7ce2 100644
--- a/Grow.c
+++ b/Grow.c
@@ -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.