]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix some fall-out from recent memset-zero for getinfo_super
authorNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 02:42:02 +0000 (12:42 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 02:42:02 +0000 (12:42 +1000)
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 <neilb@suse.de>
super-ddf.c
super-intel.c

index 21a917e4fc965f09a4155f983cd652d88092aa66..3fba2ebfdb2910fcf857752aea56ef7d7d7e8d1c 100644 (file)
@@ -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) {
index b8d8b4eb6269c1e23531c1bbb505a8ee401ba193..6fed9eb9a7f4253e172e2516d29756260bc4e39f 100644 (file)
@@ -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;