Size information is loaded already and there is no need to load it again, when metadata is not reloaded. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- Grow.c | 58 +++++++++++++++++++++++++--------------------------------- 1 files changed, 25 insertions(+), 33 deletions(-) diff --git a/Grow.c b/Grow.c index 2ca9835..6238eb3 100644 --- a/Grow.c +++ b/Grow.c @@ -2019,44 +2019,36 @@ static int reshape_array(char *container, int fd, char *devname, if (reshape.before.data_disks != reshape.after.data_disks && info->custom_array_size) { - struct mdinfo *info2; - char *subarray = strchr(info->text_version+1, '/')+1; + unsigned long long current_size = 0; + unsigned long long new_size = info->custom_array_size/2; + unsigned long long suspend_value; wait_reshape(sra); ping_monitor(container); - info2 = st->ss->container_content(st, subarray); - if (info2) { - unsigned long long current_size = 0; - unsigned long long new_size = - info2->custom_array_size/2; - unsigned long long suspend_value; - - if (sysfs_get_ll(sra, - NULL, - "array_size", - ¤t_size) == 0 && - new_size > current_size) { - if (sysfs_set_num(sra, NULL, - "array_size", new_size) - < 0) - dprintf("Error: Cannot" - " set array size"); - else - dprintf("Array size " - "changed"); - dprintf(" from %llu to %llu.\n", - current_size, new_size); - } - /* manage suspend_* entries - * set suspend_lo to suspend_hi value - * to unblock array - */ - sysfs_get_ll(sra, NULL, "suspend_hi", &suspend_value); - sysfs_set_num(sra, NULL, "suspend_lo", suspend_value); - - sysfs_free(info2); + + if (sysfs_get_ll(sra, + NULL, + "array_size", + ¤t_size) == 0 && + new_size > current_size) { + if (sysfs_set_num(sra, NULL, + "array_size", new_size) + < 0) + dprintf("Error: Cannot" + " set array size"); + else + dprintf("Array size " + "changed"); + dprintf(" from %llu to %llu.\n", + current_size, new_size); } + /* manage suspend_* entries + * set suspend_lo to suspend_hi value + * to unblock array + */ + sysfs_get_ll(sra, NULL, "suspend_hi", &suspend_value); + sysfs_set_num(sra, NULL, "suspend_lo", suspend_value); } if (info->new_level != reshape.level) { -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html