]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-gpt.c
Do not set default 'before.layout' when reshaping from RAID4 to RAID4
[thirdparty/mdadm.git] / super-gpt.c
index 9360aead2dbc4bc3ce555db3e183f0ef6575c4d6..6a2f749e2e6d4dc523d0f042ce5deb0985674546 100644 (file)
@@ -82,8 +82,6 @@ static int load_gpt(struct supertype *st, int fd, char *devname)
                return 1;
        }
 
-       ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
-
        lseek(fd, 0, 0);
        if (read(fd, super, sizeof(*super)) != sizeof(*super)) {
        no_read:
@@ -93,7 +91,7 @@ static int load_gpt(struct supertype *st, int fd, char *devname)
                free(super);
                return 1;
        }
+
        if (super->magic != MBR_SIGNATURE_MAGIC ||
            super->parts[0].part_type != MBR_GPT_PARTITION_TYPE) {
        not_found:
@@ -175,7 +173,7 @@ static void getinfo_gpt(struct supertype *st, struct mdinfo *info, char *map)
 
 static struct supertype *match_metadata_desc(char *arg)
 {
-       struct supertype *st = malloc(sizeof(*st));
+       struct supertype *st = xmalloc(sizeof(*st));
 
        if (!st)
                return st;
@@ -196,6 +194,7 @@ static struct supertype *match_metadata_desc(char *arg)
 static int validate_geometry(struct supertype *st, int level,
                             int layout, int raiddisks,
                             int *chunk, unsigned long long size,
+                            unsigned long long data_offset,
                             char *subdev, unsigned long long *freesize,
                             int verbose)
 {