]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Merge branch 'master' into devel-3.2
authorNeilBrown <neilb@suse.de>
Mon, 14 Mar 2011 07:49:57 +0000 (18:49 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 14 Mar 2011 07:49:57 +0000 (18:49 +1100)
1  2 
monitor.c
super-ddf.c

diff --combined monitor.c
index fb2288d02db62c7f28c7909fd595c0db942917a3,0a7d0f471e74d93e65f44f2a520d00b3e9ae47e7..8e0f1b7ee503dd1c509467e1cc5273b4caa300c7
+++ b/monitor.c
@@@ -215,7 -215,6 +215,7 @@@ static int read_and_act(struct active_a
  {
        unsigned long long sync_completed;
        int check_degraded = 0;
 +      int check_reshape = 0;
        int deactivate = 0;
        struct mdinfo *mdi;
        int dirty = 0;
                }
        }
  
 +      if (a->curr_state > inactive &&
 +          a->prev_state == inactive) {
 +              /* array has been started
 +               * possible that container operation has to be completed
 +               */
 +              a->container->ss->set_array_state(a, 0);
 +      }
        if (a->curr_state <= inactive &&
            a->prev_state > inactive) {
                /* array has been stopped */
                }
        }
  
 +      if (!deactivate &&
 +          a->curr_action == reshape &&
 +          a->prev_action != reshape)
 +              /* reshape was requested by mdadm.  Need to see if
 +               * new devices have been added.  Manager does that
 +               * when it sees check_reshape
 +               */
 +              check_reshape = 1;
 +
        /* Check for failures and if found:
         * 1/ Record the failure in the metadata and unblock the device.
         *    FIXME update the kernel to stop notifying on failed drives when
  
        /* Check for recovery checkpoint notifications.  We need to be a
         * minimum distance away from the last checkpoint to prevent
 -       * over checkpointing.  Note reshape checkpointing is not
 -       * handled here.
 +       * over checkpointing.  Note reshape checkpointing is handled
 +       * in the second branch.
         */
        if (sync_completed > a->last_checkpoint &&
            sync_completed - a->last_checkpoint > a->info.component_size >> 4 &&
                 */
                a->last_checkpoint = sync_completed;
                a->container->ss->set_array_state(a, a->curr_state <= clean);
 -      } else if (sync_completed > a->last_checkpoint)
 +      } else if ((a->curr_action == idle && a->prev_action == reshape) ||
 +                 (a->curr_action == reshape
 +                  && sync_completed > a->last_checkpoint) ) {
 +              /* Reshape has progressed or completed so we need to
 +               * update the array state - and possibly the array size
 +               */
 +              if (sync_completed != 0)
 +                      a->last_checkpoint = sync_completed;
 +              /* We might need to update last_checkpoint depending on
 +               * the reason that reshape finished.
 +               * if array reshape is really finished:
 +               *        set check point to the end, this allows
 +               *        set_array_state() to finalize reshape in metadata
 +               * if reshape if broken: do not set checkpoint to the end
 +               *        this allows for reshape restart from checkpoint
 +               */
 +              if ((a->curr_action != reshape) &&
 +                  (a->prev_action == reshape)) {
 +                      char buf[40];
 +                      if ((sysfs_get_str(&a->info, NULL,
 +                                        "reshape_position",
 +                                        buf,
 +                                        sizeof(buf)) >= 0) &&
 +                           strncmp(buf, "none", 4) == 0)
 +                              a->last_checkpoint = a->info.component_size;
 +              }
 +              a->container->ss->set_array_state(a, a->curr_state <= clean);
 +              a->last_checkpoint = sync_completed;
 +      }
 +
 +      if (sync_completed > a->last_checkpoint)
                a->last_checkpoint = sync_completed;
  
        a->container->ss->sync_metadata(a->container);
                        if (remove_result > 0) {
                                dprintf(" %d:removed", mdi->disk.raid_disk);
                                close(mdi->state_fd);
+                               close(mdi->recovery_fd);
                                mdi->state_fd = -1;
                        }
                }
                mdi->next_state = 0;
        }
  
 -      if (check_degraded) {
 +      if (check_degraded || check_reshape) {
                /* manager will do the actual check */
 -              a->check_degraded = 1;
 +              if (check_degraded)
 +                      a->check_degraded = 1;
 +              if (check_reshape)
 +                      a->check_reshape = 1;
                signal_manager();
        }
  
@@@ -534,7 -485,7 +535,7 @@@ static int wait_and_act(struct supertyp
                /* once an array has been deactivated we want to
                 * ask the manager to discard it.
                 */
 -              if (!a->container) {
 +              if (!a->container || (a->info.array.level == 0)) {
                        if (discard_this) {
                                ap = &(*ap)->next;
                                continue;
                                remove_pidfile(container->devname);
                        exit_now = 1;
                        signal_manager();
 +                      close(fd);
                        exit(0);
                }
        }
diff --combined super-ddf.c
index 41f5264e07efdbdd9512421207c40091ec5a014e,be15e43ebc9b9f74f1a94bd7ada1d564e9531162..8c5456834ff7c294f0d9c66580dbf10e827fdca1
@@@ -760,7 -760,7 +760,7 @@@ static int load_ddf_local(int fd, struc
  
  #ifndef MDASSEMBLE
  static int load_super_ddf_all(struct supertype *st, int fd,
 -                            void **sbp, char *devname, int keep_fd);
 +                            void **sbp, char *devname);
  #endif
  
  static void free_super_ddf(struct supertype *st);
@@@ -772,6 -772,14 +772,6 @@@ static int load_super_ddf(struct supert
        struct ddf_super *super;
        int rv;
  
 -#ifndef MDASSEMBLE
 -      /* if 'fd' is a container, load metadata from all the devices */
 -      if (load_super_ddf_all(st, fd, &st->sb, devname, 1) == 0)
 -              return 0;
 -#endif
 -      if (st->subarray[0])
 -              return 1; /* FIXME Is this correct */
 -
        if (get_dev_size(fd, devname, &dsize) == 0)
                return 1;
  
                return rv;
        }
  
 -      if (st->subarray[0]) {
 -              unsigned long val;
 -              struct vcl *v;
 -              char *ep;
 -
 -              val = strtoul(st->subarray, &ep, 10);
 -              if (*ep != '\0') {
 -                      free(super);
 -                      return 1;
 -              }
 -
 -              for (v = super->conflist; v; v = v->next)
 -                      if (v->vcnum == val)
 -                              super->currentconf = v;
 -              if (!super->currentconf) {
 -                      free(super);
 -                      return 1;
 -              }
 -      }
 -
        /* Should possibly check the sections .... */
  
        st->sb = super;
                st->minor_version = 0;
                st->max_devs = 512;
        }
 -      st->loaded_container = 0;
        return 0;
  
  }
@@@ -871,6 -900,15 +871,15 @@@ static void free_super_ddf(struct super
                        free(d->spare);
                free(d);
        }
+       while (ddf->add_list) {
+               struct dl *d = ddf->add_list;
+               ddf->add_list = d->next;
+               if (d->fd >= 0)
+                       close(d->fd);
+               if (d->spare)
+                       free(d->spare);
+               free(d);
+       }
        free(ddf);
        st->sb = NULL;
  }
@@@ -886,7 -924,6 +895,7 @@@ static struct supertype *match_metadata
  
        st = malloc(sizeof(*st));
        memset(st, 0, sizeof(*st));
 +      st->container_dev = NoMdDev;
        st->ss = &super_ddf;
        st->max_devs = 512;
        st->minor_version = 0;
@@@ -1130,6 -1167,9 +1139,9 @@@ static void examine_pds(struct ddf_supe
                       (type&8) ? "spare" : "",
                       (type&16)? ", foreign" : "",
                       (type&32)? "pass-through" : "");
+               if (state & DDF_Failed)
+                       /* This over-rides these three */
+                       state &= ~(DDF_Online|DDF_Rebuilding|DDF_Transition);
                printf("/%s%s%s%s%s%s%s",
                       (state&1)? "Online": "Offline",
                       (state&2)? ", Failed": "",
@@@ -1159,7 -1199,7 +1171,7 @@@ static void examine_super_ddf(struct su
        examine_pds(sb);
  }
  
 -static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info);
 +static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *map);
  
  static void uuid_from_super_ddf(struct supertype *st, int uuid[4]);
  
@@@ -1169,7 -1209,7 +1181,7 @@@ static void brief_examine_super_ddf(str
         */
        struct mdinfo info;
        char nbuf[64];
 -      getinfo_super_ddf(st, &info);
 +      getinfo_super_ddf(st, &info, NULL);
        fname_from_uuid(st, &info, nbuf, ':');
  
        printf("ARRAY metadata=ddf UUID=%s\n", nbuf + 5);
@@@ -1183,7 -1223,7 +1195,7 @@@ static void brief_examine_subarrays_ddf
        struct mdinfo info;
        unsigned int i;
        char nbuf[64];
 -      getinfo_super_ddf(st, &info);
 +      getinfo_super_ddf(st, &info, NULL);
        fname_from_uuid(st, &info, nbuf, ':');
  
        for (i = 0; i < __be16_to_cpu(ddf->virt->max_vdes); i++) {
@@@ -1205,7 -1245,7 +1217,7 @@@ static void export_examine_super_ddf(st
  {
        struct mdinfo info;
        char nbuf[64];
 -      getinfo_super_ddf(st, &info);
 +      getinfo_super_ddf(st, &info, NULL);
        fname_from_uuid(st, &info, nbuf, ':');
        printf("MD_METADATA=ddf\n");
        printf("MD_LEVEL=container\n");
@@@ -1231,7 -1271,7 +1243,7 @@@ static void brief_detail_super_ddf(stru
  //    struct ddf_super *ddf = st->sb;
        struct mdinfo info;
        char nbuf[64];
 -      getinfo_super_ddf(st, &info);
 +      getinfo_super_ddf(st, &info, NULL);
        fname_from_uuid(st, &info, nbuf,':');
        printf(" UUID=%s", nbuf + 5);
  }
@@@ -1318,15 -1358,14 +1330,15 @@@ static void uuid_from_super_ddf(struct 
        memcpy(uuid, buf, 4*4);
  }
  
 -static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info);
 +static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, char *map);
  
 -static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info)
 +static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *map)
  {
        struct ddf_super *ddf = st->sb;
 +      int map_disks = info->array.raid_disks;
  
        if (ddf->currentconf) {
 -              getinfo_super_ddf_bvd(st, info);
 +              getinfo_super_ddf_bvd(st, info, map);
                return;
        }
  
  
        uuid_from_super_ddf(st, info->uuid);
  
 +      if (map) {
 +              int i;
 +              for (i = 0 ; i < map_disks; i++) {
 +                      if (i < info->array.raid_disks &&
 +                          (__be16_to_cpu(ddf->phys->entries[i].state) & DDF_Online) &&
 +                          !(__be16_to_cpu(ddf->phys->entries[i].state) & DDF_Failed))
 +                              map[i] = 1;
 +                      else
 +                              map[i] = 0;
 +              }
 +      }
  }
  
  static int rlq_to_layout(int rlq, int prl, int raiddisks);
  
 -static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info)
 +static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, char *map)
  {
        struct ddf_super *ddf = st->sb;
        struct vcl *vc = ddf->currentconf;
        int cd = ddf->currentdev;
        int j;
        struct dl *dl;
 +      int map_disks = info->array.raid_disks;
  
        /* FIXME this returns BVD info - what if we want SVD ?? */
  
  
        info->array.major_version = -1;
        info->array.minor_version = -2;
 -      sprintf(info->text_version, "/%s/%s",
 +      sprintf(info->text_version, "/%s/%d",
                devnum2devname(st->container_dev),
 -              st->subarray);
 +              info->container_member);
        info->safe_mode_delay = 200;
  
        memcpy(info->name, ddf->virt->entries[info->container_member].name, 16);
        for(j=0; j<16; j++)
                if (info->name[j] == ' ')
                        info->name[j] = 0;
 +
 +      if (map)
 +              for (j = 0; j < map_disks; j++) {
 +                      map[j] = 0;
 +                      if (j <  info->array.raid_disks) {
 +                              int i = find_phys(ddf, vc->conf.phys_refnum[j]);
 +                              if (i >= 0 && 
 +                                  (__be16_to_cpu(ddf->phys->entries[i].state) & DDF_Online) &&
 +                                  !(__be16_to_cpu(ddf->phys->entries[i].state) & DDF_Failed))
 +                                      map[i] = 1;
 +                      }
 +              }
  }
  
  
@@@ -1511,27 -1526,28 +1523,27 @@@ static int update_super_ddf(struct supe
  
        if (strcmp(update, "grow") == 0) {
                /* FIXME */
 -      }
 -      if (strcmp(update, "resync") == 0) {
 +      } else if (strcmp(update, "resync") == 0) {
  //            info->resync_checkpoint = 0;
 -      }
 -      /* We ignore UUID updates as they make even less sense
 -       * with DDF
 -       */
 -      if (strcmp(update, "homehost") == 0) {
 +      } else if (strcmp(update, "homehost") == 0) {
                /* homehost is stored in controller->vendor_data,
                 * or it is when we are the vendor
                 */
  //            if (info->vendor_is_local)
  //                    strcpy(ddf->controller.vendor_data, homehost);
 -      }
 -      if (strcmp(update, "name") == 0) {
 +              rv = -1;
 +      } else if (strcmp(update, "name") == 0) {
                /* name is stored in virtual_entry->name */
  //            memset(ve->name, ' ', 16);
  //            strncpy(ve->name, info->name, 16);
 -      }
 -      if (strcmp(update, "_reshape_progress") == 0) {
 +              rv = -1;
 +      } else if (strcmp(update, "_reshape_progress") == 0) {
                /* We don't support reshape yet */
 -      }
 +      } else if (strcmp(update, "assemble") == 0 ) {
 +              /* Do nothing, just succeed */
 +              rv = 0;
 +      } else
 +              rv = -1;
  
  //    update_all_csum(ddf);
  
@@@ -2007,6 -2023,7 +2019,6 @@@ static int init_super_ddf_bvd(struct su
        }
        vcl->lba_offset = (__u64*) &vcl->conf.phys_refnum[ddf->mppe];
        vcl->vcnum = venum;
 -      sprintf(st->subarray, "%d", venum);
        vcl->block_sizes = NULL; /* FIXME not for CONCAT */
  
        vc = &vcl->conf;
@@@ -2272,7 -2289,7 +2284,7 @@@ static int add_to_super_ddf(struct supe
  
  static unsigned char null_conf[4096+512];
  
 -static int __write_init_super_ddf(struct supertype *st, int do_close)
 +static int __write_init_super_ddf(struct supertype *st)
  {
  
        struct ddf_super *ddf = st->sb;
                successes++;
        }
  
 -      if (do_close)
 -              for (d = ddf->dlist; d; d=d->next) {
 -                      close(d->fd);
 -                      d->fd = -1;
 -              }
 -
        return attempts != successes;
  }
  
@@@ -2431,7 -2454,7 +2443,7 @@@ static int write_init_super_ddf(struct 
                struct dl *d;
                for (d = ddf->dlist; d; d=d->next)
                        while (Kill(d->devname, NULL, 0, 1, 1) == 0);
 -              return __write_init_super_ddf(st, 1);
 +              return __write_init_super_ddf(st);
        }
  }
  
@@@ -2545,13 -2568,13 +2557,13 @@@ validate_geometry_ddf_container(struct 
  
  static int validate_geometry_ddf_bvd(struct supertype *st,
                                     int level, int layout, int raiddisks,
 -                                   int chunk, unsigned long long size,
 +                                   int *chunk, unsigned long long size,
                                     char *dev, unsigned long long *freesize,
                                     int verbose);
  
  static int validate_geometry_ddf(struct supertype *st,
                                 int level, int layout, int raiddisks,
 -                               int chunk, unsigned long long size,
 +                               int *chunk, unsigned long long size,
                                 char *dev, unsigned long long *freesize,
                                 int verbose)
  {
         * If given BVDs, we make an SVD, changing all the GUIDs in the process.
         */
  
 +      if (chunk && *chunk == UnSet)
 +              *chunk = DEFAULT_CHUNK;
 +
 +
        if (level == LEVEL_CONTAINER) {
                /* Must be a fresh device to add to a container */
                return validate_geometry_ddf_container(st, level, layout,
 -                                                     raiddisks, chunk,
 +                                                     raiddisks, chunk?*chunk:0,
                                                       size, dev, freesize,
                                                       verbose);
        }
                         * chosen so that add_to_super/getinfo_super
                         * can return them.
                         */
 -                      return reserve_space(st, raiddisks, size, chunk, freesize);
 +                      return reserve_space(st, raiddisks, size, chunk?*chunk:0, freesize);
                }
                return 1;
        }
                 * and try to create a bvd
                 */
                struct ddf_super *ddf;
 -              if (load_super_ddf_all(st, cfd, (void **)&ddf, NULL, 1) == 0) {
 +              if (load_super_ddf_all(st, cfd, (void **)&ddf, NULL) == 0) {
                        st->sb = ddf;
                        st->container_dev = fd2devnum(cfd);
                        close(cfd);
@@@ -2717,7 -2736,7 +2729,7 @@@ validate_geometry_ddf_container(struct 
  
  static int validate_geometry_ddf_bvd(struct supertype *st,
                                     int level, int layout, int raiddisks,
 -                                   int chunk, unsigned long long size,
 +                                   int *chunk, unsigned long long size,
                                     char *dev, unsigned long long *freesize,
                                     int verbose)
  {
  }
  
  static int load_super_ddf_all(struct supertype *st, int fd,
 -                            void **sbp, char *devname, int keep_fd)
 +                            void **sbp, char *devname)
  {
        struct mdinfo *sra;
        struct ddf_super *super;
                int rv;
  
                sprintf(nm, "%d:%d", sd->disk.major, sd->disk.minor);
 -              dfd = dev_open(nm, keep_fd? O_RDWR : O_RDONLY);
 +              dfd = dev_open(nm, O_RDWR);
                if (dfd < 0)
                        return 2;
                rv = load_ddf_headers(dfd, super, NULL);
                if (rv == 0)
 -                      rv = load_ddf_local(dfd, super, NULL, keep_fd);
 -              if (!keep_fd) close(dfd);
 +                      rv = load_ddf_local(dfd, super, NULL, 1);
                if (rv)
                        return 1;
        }
 -      if (st->subarray[0]) {
 -              unsigned long val;
 -              struct vcl *v;
 -              char *ep;
 -
 -              val = strtoul(st->subarray, &ep, 10);
 -              if (*ep != '\0') {
 -                      free(super);
 -                      return 1;
 -              }
 -
 -              for (v = super->conflist; v; v = v->next)
 -                      if (v->vcnum == val)
 -                              super->currentconf = v;
 -              if (!super->currentconf) {
 -                      free(super);
 -                      return 1;
 -              }
 -      }
  
        *sbp = super;
        if (st->ss == NULL) {
                st->ss = &super_ddf;
                st->minor_version = 0;
                st->max_devs = 512;
 -              st->container_dev = fd2devnum(fd);
        }
 -      st->loaded_container = 1;
 +      st->container_dev = fd2devnum(fd);
        return 0;
  }
 +
 +static int load_container_ddf(struct supertype *st, int fd,
 +                            char *devname)
 +{
 +      return load_super_ddf_all(st, fd, &st->sb, devname);
 +}
 +
  #endif /* MDASSEMBLE */
  
 -static struct mdinfo *container_content_ddf(struct supertype *st)
 +static struct mdinfo *container_content_ddf(struct supertype *st, char *subarray)
  {
        /* Given a container loaded by load_super_ddf_all,
         * extract information about all the arrays into
                unsigned int i;
                unsigned int j;
                struct mdinfo *this;
 +              char *ep;
 +
 +              if (subarray &&
 +                  (strtoul(subarray, &ep, 10) != vc->vcnum ||
 +                   *ep != '\0'))
 +                      continue;
 +
                this = malloc(sizeof(*this));
                memset(this, 0, sizeof(*this));
                this->next = rest;
@@@ -3125,6 -3151,9 +3137,9 @@@ static int ddf_set_array_state(struct a
        return consistent;
  }
  
+ #define container_of(ptr, type, member) ({                      \
+         const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+         (type *)( (char *)__mptr - offsetof(type,member) );})
  /*
   * The state of each disk is stored in the global phys_disk structure
   * in phys_disk.entries[n].state.
@@@ -3146,20 -3175,42 +3161,42 @@@ static void ddf_set_disk(struct active_
        struct vd_config *vc = find_vdcr(ddf, inst);
        int pd = find_phys(ddf, vc->phys_refnum[n]);
        int i, st, working;
+       struct mdinfo *mdi;
+       struct dl *dl;
  
        if (vc == NULL) {
                dprintf("ddf: cannot find instance %d!!\n", inst);
                return;
        }
-       if (pd < 0) {
-               /* disk doesn't currently exist. If it is now in_sync,
-                * insert it. */
+       /* Find the matching slot in 'info'. */
+       for (mdi = a->info.devs; mdi; mdi = mdi->next)
+               if (mdi->disk.raid_disk == n)
+                       break;
+       if (!mdi)
+               return;
+       /* and find the 'dl' entry corresponding to that. */
+       for (dl = ddf->dlist; dl; dl = dl->next)
+               if (mdi->disk.major == dl->major &&
+                   mdi->disk.minor == dl->minor)
+                       break;
+       if (!dl)
+               return;
+       if (pd < 0 || pd != dl->pdnum) {
+               /* disk doesn't currently exist or has changed.
+                * If it is now in_sync, insert it. */
                if ((state & DS_INSYNC) && ! (state & DS_FAULTY)) {
-                       /* Find dev 'n' in a->info->devs, determine the
-                        * ddf refnum, and set vc->phys_refnum and update
-                        * phys->entries[]
-                        */
-                       /* FIXME */
+                       struct vcl *vcl;
+                       pd = dl->pdnum;
+                       vc->phys_refnum[n] = dl->disk.refnum;
+                       vcl = container_of(vc, struct vcl, conf);
+                       vcl->lba_offset[n] = mdi->data_offset;
+                       ddf->phys->entries[pd].type &=
+                               ~__cpu_to_be16(DDF_Global_Spare);
+                       ddf->phys->entries[pd].type |=
+                               __cpu_to_be16(DDF_Active_in_VD);
+                       ddf->updates_pending = 1;
                }
        } else {
                int old = ddf->phys->entries[pd].state;
@@@ -3242,7 -3293,7 +3279,7 @@@ static void ddf_sync_metadata(struct su
        if (!ddf->updates_pending)
                return;
        ddf->updates_pending = 0;
 -      __write_init_super_ddf(st, 0);
 +      __write_init_super_ddf(st);
        dprintf("ddf: sync_metadata\n");
  }
  
@@@ -3366,6 -3417,14 +3403,14 @@@ static void ddf_process_update(struct s
                        memcpy(&vcl->conf, vc, update->len);
                        vcl->lba_offset = (__u64*)
                                &vcl->conf.phys_refnum[mppe];
+                       for (ent = 0;
+                            ent < __be16_to_cpu(ddf->virt->populated_vdes);
+                            ent++)
+                               if (memcmp(vc->guid, ddf->virt->entries[ent].guid,
+                                          DDF_GUID_LEN) == 0) {
+                                       vcl->vcnum = ent;
+                                       break;
+                               }
                        ddf->conflist = vcl;
                }
                /* Now make sure vlist is correct for each dl. */
@@@ -3509,7 -3568,8 +3554,8 @@@ static struct mdinfo *ddf_activate_spar
                        unsigned int j;
                        /* If in this array, skip */
                        for (d2 = a->info.devs ; d2 ; d2 = d2->next)
-                               if (d2->disk.major == dl->major &&
+                               if (d2->state_fd >= 0 &&
+                                   d2->disk.major == dl->major &&
                                    d2->disk.minor == dl->minor) {
                                        dprintf("%x:%x already in array\n", dl->major, dl->minor);
                                        break;
        }
                
        mu->buf = malloc(ddf->conf_rec_len * 512);
-       mu->len = ddf->conf_rec_len;
+       mu->len = ddf->conf_rec_len * 512;
+       mu->space = NULL;
        mu->next = *updates;
        vc = find_vdcr(ddf, a->info.container_member);
        memcpy(mu->buf, vc, ddf->conf_rec_len * 512);
@@@ -3656,15 -3717,6 +3703,15 @@@ static int ddf_level_to_layout(int leve
        }
  }
  
 +static void default_geometry_ddf(struct supertype *st, int *level, int *layout, int *chunk)
 +{
 +      if (level && *level == UnSet)
 +              *level = LEVEL_CONTAINER;
 +
 +      if (level && layout && *layout == UnSet)
 +              *layout = ddf_level_to_layout(*level);
 +}
 +
  struct superswitch super_ddf = {
  #ifndef       MDASSEMBLE
        .examine_super  = examine_super_ddf,
        .validate_geometry = validate_geometry_ddf,
        .write_init_super = write_init_super_ddf,
        .add_to_super   = add_to_super_ddf,
 +      .load_container = load_container_ddf,
  #endif
        .match_home     = match_home_ddf,
        .uuid_from_super= uuid_from_super_ddf,
        .free_super     = free_super_ddf,
        .match_metadata_desc = match_metadata_desc_ddf,
        .container_content = container_content_ddf,
 -      .default_layout = ddf_level_to_layout,
 +      .default_geometry = default_geometry_ddf,
  
        .external       = 1,