From: Czarnowska, Anna Date: Mon, 2 Apr 2012 00:18:37 +0000 (+1000) Subject: check that no disk over 2TB is used to create container when no support X-Git-Tag: mdadm-3.2.4~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9126b9a816b1576f58718dbb71bcaff2bfc274e3;p=thirdparty%2Fmdadm.git check that no disk over 2TB is used to create container when no support Creation of a container using disks over 2TB should be allowed only when orom supports large disks Signed-off-by: Anna Czarnowska Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index 7803a2e0..1bc9e9cd 100644 --- a/super-intel.c +++ b/super-intel.c @@ -5331,14 +5331,22 @@ static int validate_geometry_imsm_container(struct supertype *st, int level, return 0; } close(fd); - if (super->orom && raiddisks > super->orom->tds) { - if (verbose) - fprintf(stderr, Name ": %d exceeds maximum number of" - " platform supported disks: %d\n", - raiddisks, super->orom->tds); - - free_imsm(super); - return 0; + if (super->orom) { + if (raiddisks > super->orom->tds) { + if (verbose) + fprintf(stderr, Name ": %d exceeds maximum number of" + " platform supported disks: %d\n", + raiddisks, super->orom->tds); + free_imsm(super); + return 0; + } + if ((super->orom->attr & IMSM_OROM_ATTR_2TB_DISK) == 0 && + (ldsize >> 9) >> 32 > 0) { + if (verbose) + fprintf(stderr, Name ": %s exceeds maximum platform supported size\n", dev); + free_imsm(super); + return 0; + } } *freesize = avail_size_imsm(st, ldsize >> 9);