From: NeilBrown Date: Sun, 26 Oct 2008 23:04:46 +0000 (+1100) Subject: ddf: get endian-ness of CRC correct. X-Git-Tag: mdadm-3.0-devel2~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4abe6b708687f9982bfbc0629e1070bf49714fa3;p=thirdparty%2Fmdadm.git ddf: get endian-ness of CRC correct. All numeric fields in a DDF header big-endian, including the CRC, so better fix that. Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index db6476b1..4264bdf7 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -446,7 +446,10 @@ static int calc_crc(void *buf, int len) newcrc = crc32(0, buf, len); ddf->crc = oldcrc; - return newcrc; + /* The crc is store (like everything) bigendian, so convert + * here for simplicity + */ + return __cpu_to_be32(newcrc); } static int load_ddf_header(int fd, unsigned long long lba,