summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-12-08 11:28:54 -0700
committerDan Williams <dan.j.williams@intel.com>2008-12-08 16:59:17 -0700
commit03bcbc654f56a2bba0b82cc0bd4bbbab62425eba (patch)
tree8af19e90cf646a7a2342ded804ca3bc694cce4c9 /super-intel.c
parent959278735ebe8abf3cff95d2347ae5ed98c06811 (diff)
downloadmdadm-03bcbc654f56a2bba0b82cc0bd4bbbab62425eba.tar.gz
mdadm-03bcbc654f56a2bba0b82cc0bd4bbbab62425eba.tar.xz
mdadm-03bcbc654f56a2bba0b82cc0bd4bbbab62425eba.zip
imsm: fix setting of device size for raid1
When chunksize is 0 in the raid1 case we need to use info_to_blocks_per_member() to calculate the array size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c
index 99419ff..5677538 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1816,9 +1816,12 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
return 0;
}
strncpy((char *) dev->volume, name, MAX_RAID_SERIAL_LEN);
- array_blocks = calc_array_size(info->level, info->raid_disks,
- info->layout, info->chunk_size,
- info->size*2);
+ if (info->level == 1)
+ array_blocks = info_to_blocks_per_member(info);
+ else
+ array_blocks = calc_array_size(info->level, info->raid_disks,
+ info->layout, info->chunk_size,
+ info->size*2);
dev->size_low = __cpu_to_le32((__u32) array_blocks);
dev->size_high = __cpu_to_le32((__u32) (array_blocks >> 32));
dev->status = __cpu_to_le32(0);