summaryrefslogtreecommitdiffstats
path: root/mapfile.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-08-20 04:34:28 +0200
committerNeilBrown <neilb@suse.de>2012-08-20 04:34:28 +0200
commita74e5731ba8c32f74c60e45c244735d602d14dca (patch)
tree108030be88ca633ff04c7faaaca45c0a5dce1067 /mapfile.c
parentfind_free_devnum: avoid auto-using names in /etc/mdadm.conf (diff)
downloadmdadm-a74e5731ba8c32f74c60e45c244735d602d14dca.tar.xz
mdadm-a74e5731ba8c32f74c60e45c244735d602d14dca.zip
mapfile: fix mapfile rebuild for containers
When recreating the mapfile entry for a container we need to use ->getinfo_super, not ->container_content, just like we do in Detail(). Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mapfile.c')
-rw-r--r--mapfile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mapfile.c b/mapfile.c
index fa238832..6712733f 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -403,7 +403,12 @@ void RebuildMap(void)
close(dfd);
if (ok != 0)
continue;
- info = st->ss->container_content(st, subarray);
+ if (subarray)
+ info = st->ss->container_content(st, subarray);
+ else {
+ info = xmalloc(sizeof(*info));
+ st->ss->getinfo_super(st, info, NULL);
+ }
if (!info)
continue;