Fix restarting of reshaping arrays.

We cannot get stripe_cache_size until after the array have
been activated!!

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2010-07-29 13:50:15 +10:00
parent 510242aa48
commit 5f6ca90a9b
1 changed files with 7 additions and 7 deletions

14
Grow.c
View File

@ -1976,12 +1976,6 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
int cache;
int done = 0;
sra = sysfs_read(-1, devname2devnum(info->sys_name),
GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|
GET_CACHE);
if (!sra)
return 1;
err = sysfs_set_str(info, NULL, "array_state", "readonly");
if (err)
return err;
@ -1989,7 +1983,13 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
/* make sure reshape doesn't progress until we are ready */
sysfs_set_str(info, NULL, "sync_max", "0");
sysfs_set_str(info, NULL, "array_state", "active"); /* FIXME or clean */
sra = sysfs_read(-1, devname2devnum(info->sys_name),
GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|
GET_CACHE);
if (!sra)
return 1;
/* ndisks is not growing, so raid_disks is old and +delta is new */
odisks = info->array.raid_disks;
ndisks = odisks + info->delta_disks;