Software RAID problem on PowerPC

From: Corey Minyard (minyard@acm.org)
Date: Mon Jun 19 2000 - 09:37:34 EST


The software RAID code has a problem with PowerPC and probably most
other architectures besides the x86.

In the include/linux/raid/md_p.h include file, there is a 64-bit value
that is not aligned on a 64-bit boundary (it's named events, and I
think it's the only 64-bit value used anywhere in the md code). Since
the PowerPC compiler requires 64-bit values to be 64-bit aligned, it
adds and unused 32-bit chunk before this value, and this blows the
size of the structure past the 4096 byte boundary of the superblock,
and well, you can guess the rest from there.

This is in the current 2.2.16 release and the current 2.4 release.
I've reported this before; I guess nobody uses this on anything but
x86 or nobody in the RAID community cares about anything but x86.
But if you want the software RAID stuff to work on PowerPC, and I
expect Alpha, SPARC, and IA64, this will need to be fixed.

With this value moved to a 64-bit boundary, the code works great
on PowerPC. It's such a small problem, and the code works so well
besides, please fix :-).

You also might want to consider adding something checking the size
of the superblock to make sure it is 4096 bytes before doing anything
with it. Maybe that's overkill, though.

Thanks,

Corey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:17 EST