]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
check that no disk over 2TB is used to create container when no support
authorCzarnowska, Anna <anna.czarnowska@intel.com>
Mon, 2 Apr 2012 00:18:37 +0000 (10:18 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 2 Apr 2012 00:18:37 +0000 (10:18 +1000)
Creation of a container using disks over 2TB should be allowed only when orom supports large disks

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index 7803a2e08db10af1718bf4753289bda3e230a9b8..1bc9e9cd8e349ed4217f934103f8b05792ee1cde 100644 (file)
@@ -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);