]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: fix possible mdmon crash when updating metadata.
authorNeilBrown <neilb@suse.de>
Wed, 2 Apr 2014 04:14:43 +0000 (15:14 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 2 Apr 2014 04:14:43 +0000 (15:14 +1100)
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>
super-ddf.c

index 3a021af8e48a65929bafaea1b1b381c0b07da8cf..8530e98c77b5490956afddda039d2ed90a6efd41 100644 (file)
@@ -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),