linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DDF: _write_super_to_disk: fix anchor header type
@ 2015-05-11 14:09 Martin Wilck
  2015-05-13  0:34 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Wilck @ 2015-05-11 14:09 UTC (permalink / raw)
  To: neilb, linux-raid; +Cc: Martin Wilck

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.
---
 super-ddf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/super-ddf.c b/super-ddf.c
index d0b2ac7..faaf0a7 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);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-13  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11 14:09 [PATCH] DDF: _write_super_to_disk: fix anchor header type Martin Wilck
2015-05-13  0:34 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).