File super1-byteorder-fix of Package mdadm.import4757
Fix incorrect test in super1.c
Refernces: bnc#699667
The dev_roles array has 16bit fields, we need to byteswap
'raid_disk' as a 16bit number before comparing against dev_roles.
This bug only affect big-endian machines and can cause a meaningless warning:
wrong state in superblock
and could in unusual circumstances cause array assembly to fail.
Signed-off-by: NeilBrown <neilb@suse.de>
---
super1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- mdadm-3.1.4.orig/super1.c
+++ mdadm-3.1.4/super1.c
@@ -673,7 +673,7 @@ static int update_super1(struct supertyp
int d = info->disk.number;
int want;
if (info->disk.state == 6)
- want = __cpu_to_le32(info->disk.raid_disk);
+ want = __cpu_to_le16(info->disk.raid_disk);
else
want = 0xFFFF;
if (sb->dev_roles[d] != want) {