linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Endian issue assembling arrays
@ 2010-07-28 20:53 Doug Nazar
  2010-09-16 11:03 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Nazar @ 2010-07-28 20:53 UTC (permalink / raw)
  To: linux-raid

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

  Came across this while testing some updates to GRUB's RAID support.

Assembling a RAID1 array on a PPC box results in the following warning:

mdadm: device 1 in /dev/md/0 has wrong state in superblock, but 
/dev/sdb2 seems ok
mdadm: /dev/md/0 has been started with 2


Doug


[-- Attachment #2: mdadm-assemble-roles-endian-fix.diff --]
[-- Type: text/plain, Size: 460 bytes --]

--- mdadm-3.1.2/super1.c	2010-03-09 18:26:44.000000000 -0500
+++ mdadm-3.1.2.dev/super1.c	2010-07-28 16:41:41.000000000 -0400
@@ -673,10 +673,10 @@
 		int d = info->disk.number;
 		int want;
 		if (info->disk.state == 6)
-			want = __cpu_to_le32(info->disk.raid_disk);
+			want = info->disk.raid_disk;
 		else
 			want = 0xFFFF;
-		if (sb->dev_roles[d] != want) {
+		if (__le16_to_cpu(sb->dev_roles[d]) != want) {
 			sb->dev_roles[d] = want;
 			rv = 1;
 		}

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

end of thread, other threads:[~2010-09-16 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 20:53 Endian issue assembling arrays Doug Nazar
2010-09-16 11:03 ` Neil Brown

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).