From 188d31ed2b6dc195a4be1f5620ce2e5185d4e789 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 2 Apr 2014 15:14:43 +1100 Subject: [PATCH] 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 --- super-ddf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/super-ddf.c b/super-ddf.c index 3a021af..8530e98 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),