From: NeilBrown Date: Thu, 9 Jun 2011 02:42:02 +0000 (+1000) Subject: Fix some fall-out from recent memset-zero for getinfo_super X-Git-Tag: mdadm-3.2.2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9894ec0d64a9faab719d016bbbf5fbc842757df6;p=thirdparty%2Fmdadm.git Fix some fall-out from recent memset-zero for getinfo_super container_content_imsm was setting info->next before calling getinfo_super_imsm_container which now zeros everything. So move that assignment to afterwards. So both imsm and ddf were assuming info->disk.raid_disk means something but it doesn't. So fix those. Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index 21a917e4..3fba2ebf 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1429,9 +1429,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha info->component_size = __be64_to_cpu(vc->conf.blocks); } - for (dl = ddf->dlist; dl ; dl = dl->next) - if (dl->raiddisk == info->disk.raid_disk) - break; + dl = ddf->dlist; info->disk.major = 0; info->disk.minor = 0; if (dl) { diff --git a/super-intel.c b/super-intel.c index b8d8b4eb..6fed9eb9 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2079,9 +2079,8 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, if (prev_map) map_to_analyse = prev_map; - for (dl = super->disks; dl; dl = dl->next) - if (dl->raiddisk == info->disk.raid_disk) - break; + dl = super->disks; + info->container_member = super->current_vol; info->array.raid_disks = map->num_members; info->array.level = get_imsm_raid_level(map_to_analyse); @@ -5446,11 +5445,10 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra sizeof(*this)); break; } - memset(this, 0, sizeof(*this)); - this->next = rest; super->current_vol = i; getinfo_super_imsm_volume(st, this, NULL); + this->next = rest; for (slot = 0 ; slot < map->num_members; slot++) { unsigned long long recovery_start; struct mdinfo *info_d;