}
if (st && ! st->ss->validate_geometry(st, level, layout, raiddisks,
- chunk, size, NULL, NULL, verbose>=0))
+ chunk, size*2, NULL, NULL, verbose>=0))
return 1;
/* now look at the subdevs */
st = superlist[i]->match_metadata_desc(name);
if (st && !st->ss->validate_geometry
(st, level, layout, raiddisks,
- chunk, size, dname, &freesize,
+ chunk, size*2, dname, &freesize,
verbose > 0))
st = NULL;
}
} else {
if (!st->ss->validate_geometry(st, level, layout,
raiddisks,
- chunk, size, dname,
+ chunk, size*2, dname,
&freesize,
verbose > 0)) {
/* size is meaningful */
if (!st->ss->validate_geometry(st, level, layout,
raiddisks,
- chunk, minsize,
+ chunk, minsize*2,
NULL, NULL, 0)) {
fprintf(stderr, Name ": devices too large for RAID level %d\n", level);
return 1;
* added to validate changing size and new devices. If there are
* inter-device dependencies, it should record sufficient details
* so these can be validated.
+ * Both 'size' and '*freesize' are in sectors. chunk is bytes.
*/
int (*validate_geometry)(struct supertype *st, int level, int layout,
int raiddisks,
* 'raiddisks' device extents of size 'size' at a given
* offset
*/
- unsigned long long minsize = size*2 /* convert to blocks */;
+ unsigned long long minsize = size;
unsigned long long start_offset = ~0ULL;
int dcnt = 0;
if (minsize == 0)
return 0;
if (raiddisks > MD_SB_DISKS)
return 0;
- if (size > (0x7fffffffULL<<10))
+ if (size > (0x7fffffffULL<<9))
return 0;
if (!subdev)
return 1;
if (ldsize < MD_RESERVED_SECTORS * 512)
return 0;
- if (size > (0x7fffffffULL<<10))
+ if (size > (0x7fffffffULL<<9))
return 0;
*freesize = MD_NEW_SIZE_SECTORS(ldsize >> 9);
return 1;