From: NeilBrown Date: Thu, 10 Mar 2016 07:06:59 +0000 (+1100) Subject: ddf: use 64bit 'size', not 32bit 'info->size' for create. X-Git-Tag: mdadm-4.0~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eddaacc304ba34a28ebba4b0239dd2da072b54bb;p=thirdparty%2Fmdadm.git ddf: use 64bit 'size', not 32bit 'info->size' for create. The 'size' field of mdu_disk_info_t is 32bit and should not be used except for legacy ioctls. super-ddf got this wrong :-( This change makes it possible to create ddf arrays which used more than 2TB of each device. Reported-by: Dan Russell Signed-off-by: NeilBrown Signed-off-by: Jes Sorensen --- diff --git a/super-ddf.c b/super-ddf.c index faaf0a7c..1707ad1e 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -2688,10 +2688,10 @@ static int init_super_ddf_bvd(struct supertype *st, free(vcl); return 0; } - vc->blocks = cpu_to_be64(info->size * 2); + vc->blocks = cpu_to_be64(size * 2); vc->array_blocks = cpu_to_be64( calc_array_size(info->level, info->raid_disks, info->layout, - info->chunk_size, info->size*2)); + info->chunk_size, size * 2)); memset(vc->pad1, 0xff, 8); vc->spare_refs[0] = cpu_to_be32(0xffffffff); vc->spare_refs[1] = cpu_to_be32(0xffffffff);