For secondary RAID, we need to check which BVD needs to be updated. Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- super-ddf.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/super-ddf.c b/super-ddf.c index 8e1d502..77c00b2 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -4282,7 +4282,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 */ -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html