summaryrefslogtreecommitdiff
path: root/super-ddf.c
diff options
context:
space:
mode:
authormwilck@arcor.de <mwilck@arcor.de>2013-07-03 22:28:05 +0200
committerNeilBrown <neilb@suse.de>2013-07-08 16:50:46 +1000
commit21a635519ea21b52bd3642a8582b14c7d1804104 (patch)
tree51794e0be45a6d15b1b74d73a95932a2b14341a2 /super-ddf.c
parentb27336a28ef08c354b168ccf8ed967eccb213302 (diff)
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 <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c17
1 files changed, 16 insertions, 1 deletions
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 */