diff options
author | Neil Brown <neilb@suse.de> | 2008-07-12 20:28:38 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-07-12 20:28:38 +1000 |
commit | 047d2e49f52a25cc88781d11cd83e147791975d6 (patch) | |
tree | e4cf33f32d5a391f7ac864f718be06093043e4b4 /sysfs.c | |
parent | 6416d5275d65be25a6cd63583bb2b92e6fba95a5 (diff) | |
download | mdadm-047d2e49f52a25cc88781d11cd83e147791975d6.tar.gz mdadm-047d2e49f52a25cc88781d11cd83e147791975d6.tar.xz mdadm-047d2e49f52a25cc88781d11cd83e147791975d6.zip |
Correct unit conversion for component_size and dev/size in sysfs.
These are both Kilobytes, so do the conversion to sectors properly.
Diffstat (limited to 'sysfs.c')
-rw-r--r-- | sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -234,7 +234,7 @@ struct mdinfo *sysfs_read(int fd, int devnum, unsigned long options) strcpy(dbase, "size"); if (load_sys(fname, buf)) goto abort; - dev->component_size = strtoull(buf, NULL, 0); + dev->component_size = strtoull(buf, NULL, 0) * 2; } if (options & GET_STATE) { dev->disk.state = 0; @@ -359,7 +359,7 @@ int sysfs_set_array(struct mdinfo *sra, rv |= sysfs_set_num(sra, NULL, "raid_disks", info->array.raid_disks); rv |= sysfs_set_num(sra, NULL, "chunk_size", info->array.chunk_size); rv |= sysfs_set_num(sra, NULL, "layout", info->array.layout); - rv |= sysfs_set_num(sra, NULL, "component_size", info->component_size); + rv |= sysfs_set_num(sra, NULL, "component_size", info->component_size/2); rv |= sysfs_set_num(sra, NULL, "resync_start", info->resync_start); sra->array = info->array; return rv; |