From: mwilck@arcor.de Date: Wed, 3 Jul 2013 20:28:05 +0000 (+0200) Subject: DDF: ddf_process_update: handle update of conf records for SVD X-Git-Tag: mdadm-3.3-rc2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21a635519ea21b52bd3642a8582b14c7d1804104;p=thirdparty%2Fmdadm.git DDF: ddf_process_update: handle update of conf records for SVD For secondary RAID, we need to check which BVD needs to be updated. Signed-off-by: Martin Wilck Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index c50faf9d..ccf44ce7 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -4285,7 +4285,22 @@ static void ddf_process_update(struct supertype *st, /* An update, just copy the phys_refnum and lba_offset * fields */ - memcpy(vcl->conf.phys_refnum, vc->phys_refnum, + struct vd_config *conf = &vcl->conf; + if (vcl->other_bvds != NULL && + conf->sec_elmnt_seq != vc->sec_elmnt_seq) { + unsigned int i; + for (i = 1; i < conf->sec_elmnt_count; i++) + if (vcl->other_bvds[i-1]->sec_elmnt_seq + == vc->sec_elmnt_seq) + break; + if (i == conf->sec_elmnt_count) { + pr_err("%s/DDF_VD_CONF_MAGIC: BVD %u not found\n", + __func__, vc->sec_elmnt_seq); + return; + } + conf = vcl->other_bvds[i-1]; + } + memcpy(conf->phys_refnum, vc->phys_refnum, mppe * (sizeof(__u32) + sizeof(__u64))); } else { /* A new VD_CONF */