diff options
author | NeilBrown <neilb@suse.de> | 2011-03-14 18:47:47 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-03-14 18:47:47 +1100 |
commit | 1502a43a08d0648a6b03d89b7cf189f15bea8647 (patch) | |
tree | 6352f231603643f815e2acf81b1b32258fa5760a | |
parent | e1316fab98d1ad5b3e07be7ee56b07b0e25353ec (diff) | |
download | mdadm-1502a43a08d0648a6b03d89b7cf189f15bea8647.tar.gz |
ddf: set vcnum correctly when creating a new virtual device in conflist
We weren't setting ->vcnum at all when an array was added. This
meant that a subsequent device failure could be assigned to the
wrong array.
Reported-by: Albert Pauw <albert.pauw@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | super-ddf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/super-ddf.c b/super-ddf.c index 8cc738a..be15e43 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3417,6 +3417,14 @@ static void ddf_process_update(struct supertype *st, 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. */ |