]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: init_super_ddf_bvd: initialize other bvds
authormwilck@arcor.de <mwilck@arcor.de>
Wed, 3 Jul 2013 20:27:54 +0000 (22:27 +0200)
committerNeilBrown <neilb@suse.de>
Mon, 8 Jul 2013 06:48:32 +0000 (16:48 +1000)
Properly initialize the data structures of the other BVDs
in Create().

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index 7e056f5570ef79ced02c1d19fa15c8ee7e950bad..f0a20c652abc2b829da6d554363e1561e81f1be6 100644 (file)
@@ -2331,7 +2331,7 @@ static int init_super_ddf_bvd(struct supertype *st,
         * We need to create a new vd_config and a new virtual_entry
         */
        struct ddf_super *ddf = st->sb;
-       unsigned int venum;
+       unsigned int venum, i;
        struct virtual_entry *ve;
        struct vcl *vcl;
        struct vd_config *vc;
@@ -2426,6 +2426,11 @@ static int init_super_ddf_bvd(struct supertype *st,
        memset(vc->phys_refnum, 0xff, 4*ddf->mppe);
        memset(vc->phys_refnum+ddf->mppe, 0x00, 8*ddf->mppe);
 
+       for (i = 1; i < vc->sec_elmnt_count; i++) {
+               memcpy(vcl->other_bvds[i-1], vc, ddf->conf_rec_len * 512);
+               vcl->other_bvds[i-1]->sec_elmnt_seq = i;
+       }
+
        vcl->next = ddf->conflist;
        ddf->conflist = vcl;
        ddf->currentconf = vcl;