]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-mbr.c
DDF: Don't fail compare_super_ddf due to re-configure changes.
[thirdparty/mdadm.git] / super-mbr.c
index 3b0cc8d8fa45c68849a2e4624d87a96b5e1908ff..0fcac7c3133e3f79d7e556387ddb6a8f4b39fdd2 100644 (file)
@@ -86,8 +86,6 @@ static int load_super_mbr(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)) {
                if (devname)
@@ -96,7 +94,7 @@ static int load_super_mbr(struct supertype *st, int fd, char *devname)
                free(super);
                return 1;
        }
+
        if (super->magic != MBR_SIGNATURE_MAGIC) {
                if (devname)
                        pr_err("No partition table found on %s\n",
@@ -126,8 +124,6 @@ static int store_mbr(struct supertype *st, int fd)
                return 1;
        }
 
-       ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
-
        lseek(fd, 0, 0);
        if (read(fd, old, sizeof(*old)) != sizeof(*old)) {
                free(old);
@@ -158,7 +154,7 @@ static void getinfo_mbr(struct supertype *st, struct mdinfo *info, char *map)
 
        for (i = 0; i < MBR_PARTITIONS ; i++)
                if (sb->parts[i].blocks_num) {
-                       unsigned long last = 
+                       unsigned long last =
                                (unsigned long)__le32_to_cpu(sb->parts[i].blocks_num)
                                + (unsigned long)__le32_to_cpu(sb->parts[i].first_sect_lba);
                        if (last > info->component_size)
@@ -174,9 +170,7 @@ static struct supertype *match_metadata_desc(char *arg)
        if (strcmp(arg, "mbr") != 0)
                return NULL;
 
-       st = malloc(sizeof(*st));
-       if (!st)
-               return st;
+       st = xmalloc(sizeof(*st));
        st->ss = &mbr;
        st->info = NULL;
        st->minor_version = 0;
@@ -189,6 +183,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)
 {