diff options
author | NeilBrown <neilb@suse.de> | 2013-06-27 05:10:44 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-06-27 05:10:44 +0200 |
commit | dfa4d769f0bd3b8a603636afec2a4f7c5173b0a8 (patch) | |
tree | 31407a67f5d669979750d9278b134fad0c6b6069 /Grow.c | |
parent | Grow: lack of head/tail space not fatal for RAID5 etc. (diff) | |
download | mdadm-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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. |