summaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-04-12 00:58:28 -0700
committerDan Williams <dan.j.williams@intel.com>2009-04-12 00:58:28 -0700
commitda9b4a62af80edbbcc96196ab5d887308516ba70 (patch)
tree374cdc6439e4a59161fc2739e752e4ef6ab50248 /sysfs.c
parentda1887895404506708387fa3781bf0df0a2664ff (diff)
downloadmdadm-da9b4a62af80edbbcc96196ab5d887308516ba70.tar.gz
mdadm-da9b4a62af80edbbcc96196ab5d887308516ba70.tar.xz
mdadm-da9b4a62af80edbbcc96196ab5d887308516ba70.zip
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 <dan.j.williams@intel.com>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c14
1 files changed, 14 insertions, 0 deletions
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;