From da9b4a62af80edbbcc96196ab5d887308516ba70 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 12 Apr 2009 00:58:28 -0700 Subject: imsm: set array size at Create/Assemble imsm arrays round down the effective array size to the closest 1 megabyte boundary so teach get_info_super_imsm and sysfs_set_array to set 'md/array_size' if available (and make sure ddf uses the default size). Signed-off-by: Dan Williams --- sysfs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index 2dad7d3..48d1f54 100644 --- a/sysfs.c +++ b/sysfs.c @@ -506,6 +506,20 @@ int sysfs_set_array(struct mdinfo *info, int vers) rv |= sysfs_set_num(info, NULL, "chunk_size", info->array.chunk_size); rv |= sysfs_set_num(info, NULL, "layout", info->array.layout); rv |= sysfs_set_num(info, NULL, "component_size", info->component_size/2); + if (info->custom_array_size) { + int rc; + + rc = sysfs_set_num(info, NULL, "array_size", + info->custom_array_size/2); + if (rc && errno == ENOENT) { + fprintf(stderr, Name ": This kernel does not " + "have the md/array_size attribute, " + "the array may be larger than expected\n"); + rc = 0; + } + rv |= rc; + } + if (info->array.level > 0) rv |= sysfs_set_num(info, NULL, "resync_start", info->resync_start); return rv; -- cgit