summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-04-02 06:14:43 +0200
committerNeilBrown <neilb@suse.de>2014-04-02 06:14:43 +0200
commit188d31ed2b6dc195a4be1f5620ce2e5185d4e789 (patch)
tree18fdada11e9d051468d60cc9c499783c9f9fae02 /super-ddf.c
parentDDF: guard against ->pdnum being negative. (diff)
downloadmdadm-188d31ed2b6dc195a4be1f5620ce2e5185d4e789.tar.xz
mdadm-188d31ed2b6dc195a4be1f5620ce2e5185d4e789.zip
DDF: fix possible mdmon crash when updating metadata.
Testing 'c' and then using 'vdc' assumes that the two are in sync, but sometimes they aren't. Testing 'vdc' is safer. This avoids a crash in some cases when failing/removing/added devices to a DDF. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 3a021af8..8530e98c 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -3022,7 +3022,7 @@ static int __write_ddf_structure(struct dl *d, struct ddf_super *ddf, __u8 type)
(const struct vd_config **)&vdc,
&dummy);
}
- if (c) {
+ if (vdc) {
dprintf("writing conf record %i on disk %08x for %s/%u\n",
i, be32_to_cpu(d->disk.refnum),
guid_str(vdc->guid),