summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-06-27 05:10:44 +0200
committerNeilBrown <neilb@suse.de>2013-06-27 05:10:44 +0200
commitdfa4d769f0bd3b8a603636afec2a4f7c5173b0a8 (patch)
tree31407a67f5d669979750d9278b134fad0c6b6069 /Grow.c
parentGrow: lack of head/tail space not fatal for RAID5 etc. (diff)
downloadmdadm-dfa4d769f0bd3b8a603636afec2a4f7c5173b0a8.tar.xz
mdadm-dfa4d769f0bd3b8a603636afec2a4f7c5173b0a8.zip
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.