]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
imsm: fix reshape for >2TB drives
[thirdparty/mdadm.git] / super-ddf.c
index c2336013a6c59c1b994e97156203a07b3e840979..618542c4b7dd5bc037b434317ea365bf7b753df9 100644 (file)
@@ -2881,8 +2881,9 @@ static int add_to_super_ddf(struct supertype *st,
        dd->disk.magic = DDF_PHYS_DATA_MAGIC;
        now = time(0);
        tm = localtime(&now);
-       sprintf(dd->disk.guid, "%8s%04d%02d%02d",
-               T10, tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
+       sprintf(dd->disk.guid, "%8s%04d%02d%02d", T10,
+               (__u16)tm->tm_year+1900,
+               (__u8)tm->tm_mon+1, (__u8)tm->tm_mday);
        tptr = (__u32 *)(dd->disk.guid + 16);
        *tptr++ = random32();
        *tptr = random32();
@@ -3511,8 +3512,8 @@ static int validate_geometry_ddf_bvd(struct supertype *st,
                if (minsize == 0)
                        minsize = 8;
                for (dl = ddf->dlist; dl ; dl = dl->next) {
-                       if (find_space(ddf, dl, data_offset, &minsize)
-                           != INVALID_SECTORS)
+                       if (find_space(ddf, dl, data_offset, &minsize) !=
+                           INVALID_SECTORS)
                                dcnt++;
                }
                if (dcnt < raiddisks) {
@@ -4004,8 +4005,8 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst)
                        continue;
 
                if (posix_memalign((void **)&dl1, 512,
-                      sizeof(*dl1) + (first->max_part) * sizeof(dl1->vlist[0]))
-                   != 0) {
+                                  sizeof(*dl1) + (first->max_part) *
+                                  sizeof(dl1->vlist[0])) != 0) {
                        pr_err("could not allocate disk info buffer\n");
                        return 3;
                }