diff options
-rw-r--r-- | Assemble.c | 2 | ||||
-rw-r--r-- | Create.c | 2 | ||||
-rw-r--r-- | Incremental.c | 3 | ||||
-rw-r--r-- | mdadm.h | 1 | ||||
-rw-r--r-- | super-ddf.c | 2 | ||||
-rw-r--r-- | super-intel.c | 2 | ||||
-rw-r--r-- | super0.c | 1 | ||||
-rw-r--r-- | super1.c | 1 |
8 files changed, 8 insertions, 6 deletions
@@ -418,7 +418,6 @@ int Assemble(struct supertype *st, char *mddev, int uuid[4]; content = &info; - memset(content, 0, sizeof(*content)); tst->ss->getinfo_super(tst, content, NULL); if (!parse_uuid(ident->container, uuid) || @@ -484,7 +483,6 @@ int Assemble(struct supertype *st, char *mddev, } else { content = &info; - memset(content, 0, sizeof(*content)); tst->ss->getinfo_super(tst, content, NULL); if (!ident_matches(ident, content, tst, @@ -658,8 +658,8 @@ int Create(struct supertype *st, char *mddev, goto abort; total_slots = info.array.nr_disks; - sysfs_init(&info, mdfd, 0); st->ss->getinfo_super(st, &info, NULL); + sysfs_init(&info, mdfd, 0); if (did_default && verbose >= 0) { if (is_subarray(info.text_version)) { diff --git a/Incremental.c b/Incremental.c index 14184da0..f576cbae 100644 --- a/Incremental.c +++ b/Incremental.c @@ -202,7 +202,6 @@ int Incremental(char *devname, int verbose, int runstop, } close (dfd); dfd = -1; - memset(&info, 0, sizeof(info)); st->ss->getinfo_super(st, &info, NULL); /* 3/ Check if there is a match in mdadm.conf */ @@ -396,7 +395,6 @@ int Incremental(char *devname, int verbose, int runstop, goto out; } close(dfd2); - memset(&info2, 0, sizeof(info2)); st2->ss->getinfo_super(st2, &info2, NULL); st2->ss->free_super(st2); if (info.array.level != info2.array.level || @@ -1435,7 +1433,6 @@ static int Incremental_container(struct supertype *st, char *devname, int suuid[4]; int sfd; - memset(&info, 0, sizeof(info)); st->ss->getinfo_super(st, &info, NULL); if ((runstop > 0 && info.container_enough >= 0) || @@ -616,6 +616,7 @@ extern struct superswitch { * (raid_disk must already be set and correct) and it is filled * with 1 for slots that are thought to be active and 0 for slots which * appear to be failed/missing. + * *info is zeroed out before data is added. */ void (*getinfo_super)(struct supertype *st, struct mdinfo *info, char *map); struct mdinfo *(*getinfo_super_disks)(struct supertype *st); diff --git a/super-ddf.c b/super-ddf.c index 8f88b708..21a917e4 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1341,6 +1341,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *m getinfo_super_ddf_bvd(st, info, map); return; } + memset(info, 0, sizeof(*info)); info->array.raid_disks = __be16_to_cpu(ddf->phys->used_pdes); info->array.level = LEVEL_CONTAINER; @@ -1406,6 +1407,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha struct dl *dl; int map_disks = info->array.raid_disks; + memset(info, 0, sizeof(*info)); /* FIXME this returns BVD info - what if we want SVD ?? */ info->array.raid_disks = __be16_to_cpu(vc->conf.prim_elmnt_count); diff --git a/super-intel.c b/super-intel.c index e401eb01..b1461c64 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1764,6 +1764,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, unsigned int component_size_alligment; int map_disks = info->array.raid_disks; + memset(info, 0, sizeof(*info)); if (prev_map) map_to_analyse = prev_map; @@ -1972,6 +1973,7 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char * getinfo_super_imsm_volume(st, info, map); return; } + memset(info, 0, sizeof(*info)); /* Set raid_disks to zero so that Assemble will always pull in valid * spares @@ -346,6 +346,7 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map) int i; int map_disks = info->array.raid_disks; + memset(info, 0, sizeof(*info)); info->array.major_version = sb->major_version; info->array.minor_version = sb->minor_version; info->array.patch_version = sb->patch_version; @@ -566,6 +566,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) unsigned int role; unsigned int map_disks = info->array.raid_disks; + memset(info, 0, sizeof(*info)); info->array.major_version = 1; info->array.minor_version = st->minor_version; info->array.patch_version = 0; |