]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-intel.c
Fix two typos in fprintf messages
[thirdparty/mdadm.git] / super-intel.c
index 7803a2e08db10af1718bf4753289bda3e230a9b8..ed7792dc6333d7c177036c7d2dffa9b5968f9008 100644 (file)
@@ -5048,6 +5048,9 @@ static int write_super_imsm_spares(struct intel_super *super, int doclose)
                        continue;
 
                spare->disk[0] = d->disk;
+               if (__le32_to_cpu(d->disk.total_blocks_hi) > 0)
+                       spare->attributes |= MPB_ATTRIB_2TB_DISK;
+
                sum = __gen_imsm_checksum(spare);
                spare->family_num = __cpu_to_le32(sum);
                spare->orig_family_num = 0;
@@ -5331,14 +5334,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);
@@ -6078,7 +6089,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
                int count = count_volumes(super->hba->path,
                                      super->orom->dpa, verbose);
                if (super->orom->vphba <= count) {
-                       pr_vrb(": platform does not support more then %d raid volumes.\n",
+                       pr_vrb(": platform does not support more than %d raid volumes.\n",
                               super->orom->vphba);
                        return 0;
                }
@@ -6212,7 +6223,7 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
                                                      super->orom->dpa, verbose);
                                if (super->orom->vphba <= count) {
                                        pr_vrb(": platform does not support more"
-                                              "then %d raid volumes.\n",
+                                              " than %d raid volumes.\n",
                                               super->orom->vphba);
                                        return 0;
                                }