From: Martin Wilck Date: Mon, 11 May 2015 14:09:44 +0000 (+0200) Subject: DDF: _write_super_to_disk: fix anchor header type X-Git-Tag: mdadm-3.3.3~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b87fdf4e891093e4a98f724d4a5f013fcaa94168;p=thirdparty%2Fmdadm.git DDF: _write_super_to_disk: fix anchor header type Since commit 30bee0201, the anchor is updated from the active DDF header. This requires fixing the header type before the anchor is written. The LSI Software RAID code will reject DDF meta data with wrong anchor type and will erase all meta data when it encounters such a broken anchor. Thus starting Linux md once on a system with LSI RAID BIOS may cause the meta data to get destroyed. Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index d0b2ac71..faaf0a7c 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3158,6 +3158,7 @@ static int _write_super_to_disk(struct ddf_super *ddf, struct dl *d) memcpy(&ddf->primary, &ddf->anchor, 512); memcpy(&ddf->secondary, &ddf->anchor, 512); + ddf->anchor.type = DDF_HEADER_ANCHOR; ddf->anchor.openflag = 0xFF; /* 'open' means nothing */ ddf->anchor.seq = cpu_to_be32(0xFFFFFFFF); /* no sequencing in anchor */ ddf->anchor.crc = calc_crc(&ddf->anchor, 512);