]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mapfile: fix mapfile rebuild for containers
authorNeilBrown <neilb@suse.de>
Thu, 27 Sep 2012 06:58:42 +0000 (16:58 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 27 Sep 2012 06:58:42 +0000 (16:58 +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 70ff3558361bf543db55c0fcb7e9042e22386820..d416408bd08ee963d8922153157a9111cefdcbd3 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 = malloc(sizeof(*info));
+                               st->ss->getinfo_super(st, info, NULL);
+                       }
                        if (!info)
                                continue;