[PATCH 6/6] check that no disk over 2TB is used to create container when no support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Creation of a container using disks over 2TB should be allowed only when orom supports large disks

Signed-off-by: Anna Czarnowska <anna.czarnowska@xxxxxxxxx>
---
 super-intel.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index d0b1442..393a657 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);
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux