summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-06-15 15:49:23 +1000
committerNeilBrown <neilb@suse.de>2011-06-15 15:49:23 +1000
commitfb204fb2e166774a8d8d1c73aa8362a6101d64fa (patch)
treefdd20206aee8902be22f8b6cdfb9a04e131549e1
parent9ec11d1afd4abc303ec4a8ea25eea0cb155dcc8f (diff)
downloadmdadm-fb204fb2e166774a8d8d1c73aa8362a6101d64fa.tar.gz
ddf: fix up getinfo_super_bvd
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>
-rw-r--r--super-ddf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 3fba2eb..7312ba4 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -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;