diff --git a/Manage.c b/Manage.c index 8d1bbd9..0b0b785 100644 --- a/Manage.c +++ b/Manage.c @@ -718,10 +718,8 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, return -1; } - if (tst->ss->validate_geometry( - tst, array->level, array->layout, - array->raid_disks, NULL, - ldsize >> 9, INVALID_SECTORS, NULL, NULL, 0) == 0) { + if (tst->ss == &super0 && ldsize > 4ULL*1024*1024*2) { + /* More than 4TB is wasted on v0.90 */ if (!force) { pr_err("%s is larger than %s can " "effectively use.\n" diff --git a/super-ddf.c b/super-ddf.c index 47074fe..683f969 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3185,14 +3185,14 @@ static int validate_geometry_ddf(struct supertype *st, * If given BVDs, we make an SVD, changing all the GUIDs in the process. */ - if (chunk && *chunk == UnSet) + if (*chunk == UnSet) *chunk = DEFAULT_CHUNK; if (level == -1000000) level = LEVEL_CONTAINER; if (level == LEVEL_CONTAINER) { /* Must be a fresh device to add to a container */ return validate_geometry_ddf_container(st, level, layout, - raiddisks, chunk?*chunk:0, + raiddisks, *chunk, size, data_offset, dev, freesize, verbose); @@ -3220,7 +3220,7 @@ static int validate_geometry_ddf(struct supertype *st, * chosen so that add_to_super/getinfo_super * can return them. */ - return reserve_space(st, raiddisks, size, chunk?*chunk:0, freesize); + return reserve_space(st, raiddisks, size, *chunk, freesize); } return 1; } diff --git a/super-intel.c b/super-intel.c index baea13c..4df33f4 100644 --- a/super-intel.c +++ b/super-intel.c @@ -5854,10 +5854,10 @@ validate_geometry_imsm_orom(struct intel_super *super, int level, int layout, return 0; } - if (chunk && (*chunk == 0 || *chunk == UnSet)) + if (*chunk == 0 || *chunk == UnSet) *chunk = imsm_default_chunk(super->orom); - if (super->orom && chunk && !imsm_orom_has_chunk(super->orom, *chunk)) { + if (super->orom && !imsm_orom_has_chunk(super->orom, *chunk)) { pr_vrb(": platform does not support a chunk size of: " "%d\n", *chunk); return 0; @@ -5874,7 +5874,7 @@ validate_geometry_imsm_orom(struct intel_super *super, int level, int layout, return 0; } - if (super->orom && (super->orom->attr & IMSM_OROM_ATTR_2TB) == 0 && chunk && + if (super->orom && (super->orom->attr & IMSM_OROM_ATTR_2TB) == 0 && (calc_array_size(level, raiddisks, layout, *chunk, size) >> 32) > 0) { pr_vrb(": platform does not support a volume size over 2TB\n"); return 0; @@ -6188,7 +6188,7 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout, /* Must be a fresh device to add to a container */ return validate_geometry_imsm_container(st, level, layout, raiddisks, - chunk?*chunk:0, + *chunk, size, data_offset, dev, freesize, verbose); @@ -6224,7 +6224,7 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout, } if (freesize) return reserve_space(st, raiddisks, size, - chunk?*chunk:0, freesize); + *chunk, freesize); } return 1; } diff --git a/super0.c b/super0.c index 85acf36..3218377 100644 --- a/super0.c +++ b/super0.c @@ -1274,7 +1274,7 @@ static int validate_geometry0(struct supertype *st, int level, "%d terabytes per device\n", tbmax); return 0; } - if (chunk && *chunk == UnSet) + if (*chunk == UnSet) *chunk = DEFAULT_CHUNK; if (!subdev) diff --git a/super1.c b/super1.c index eb42058..f840459 100644 --- a/super1.c +++ b/super1.c @@ -2302,7 +2302,7 @@ static int validate_geometry1(struct supertype *st, int level, pr_err("1.x metadata does not support containers\n"); return 0; } - if (chunk && *chunk == UnSet) + if (*chunk == UnSet) *chunk = DEFAULT_CHUNK; if (!subdev)