]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
ddf: fix up getinfo_super_bvd
authorNeilBrown <neilb@suse.de>
Wed, 15 Jun 2011 05:49:23 +0000 (15:49 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 15 Jun 2011 05:49:23 +0000 (15:49 +1000)
Now that getinfo_super clears the info structure, we need
to make sure the correct values are filled in to info->dev.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index 3fba2ebfdb2910fcf857752aea56ef7d7d7e8d1c..7312ba4b012a92c2e696182ae7fc33b4d7f03c03 100644 (file)
@@ -1429,16 +1429,20 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha
                        info->component_size = __be64_to_cpu(vc->conf.blocks);
        }
 
-       dl = ddf->dlist;
+       for (dl = ddf->dlist; dl ; dl = dl->next)
+               if (dl->raiddisk == ddf->currentdev)
+                       break;
+
        info->disk.major = 0;
        info->disk.minor = 0;
+       info->disk.state = 0;
        if (dl) {
                info->disk.major = dl->major;
                info->disk.minor = dl->minor;
+               info->disk.raid_disk = dl->raiddisk;
+               info->disk.number = dl->pdnum;
+               info->disk.state = (1<<MD_DISK_SYNC)|(1<<MD_DISK_ACTIVE);
        }
-//     info->disk.number = __be32_to_cpu(ddf->disk.refnum);
-//     info->disk.raid_disk = find refnum in the table and use index;
-//     info->disk.state = ???;
 
        info->container_member = ddf->currentconf->vcnum;