]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mapfile: fix mapfile rebuild for containers
authorNeilBrown <neilb@suse.de>
Mon, 20 Aug 2012 02:34:28 +0000 (12:34 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 20 Aug 2012 02:34:28 +0000 (12:34 +1000)
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>
mapfile.c

index fa238832ab6ba633ef08960125f37242945cfd09..6712733ffa651030ace480e50f4b908c106b3838 100644 (file)
--- 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;