]> git.hungrycats.org Git - linux/commit
[PATCH] md: fix problems with checksum handling in MD superblocks.
authorNeil Brown <neilb@cse.unsw.edu.au>
Fri, 27 Aug 2004 03:30:20 +0000 (20:30 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 27 Aug 2004 03:30:20 +0000 (20:30 -0700)
commite50873c0fe87b08a467e16f6c24371d7e4a81b8c
tree1f85df6273ab55ca86d8ae8f0335db8b64a046e7
parent9c9481ab4d77c8383fce5842ae77aae263eb54a0
[PATCH] md: fix problems with checksum handling in MD superblocks.

md currently uses csum_partial to calculate checksums for superblocks.
However this function is not consistent across all architectures.  Some
(i386) to a 32bit csum.  Some (alpha) do a 16 bit csum.  This makes it hard
for userspace to keep up.

So we provide a generic routine (that does exactly what the i386
csum_partial does) and:

- When setting the csum, use csum_partial so that old kernels will still
  recognise the superblock

- When checking the csum, allow either csum_partial or the new generic
  code to provide the right csum.  This allows user-space to just use the
  common code and always work.

Also modify the csum for version-1 superblock (which currently aren't being
used) to always user a predictable checksum algorithm.

Thanks to Mike Tran <mhtran@us.ibm.com> for noticing this.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/md.c