From: Dan Williams Date: Mon, 8 Dec 2008 18:28:54 +0000 (-0700) Subject: imsm: fix setting of device size for raid1 X-Git-Tag: mdadm-3.0-devel3~56^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03bcbc654f56a2bba0b82cc0bd4bbbab62425eba;p=thirdparty%2Fmdadm.git 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 --- diff --git a/super-intel.c b/super-intel.c index 99419ffd..56775385 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);