From 03bcbc654f56a2bba0b82cc0bd4bbbab62425eba Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Dec 2008 11:28:54 -0700 Subject: [PATCH] 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 --- super-intel.c | 9 ++++++--- 1 file 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);