From: Dan Williams Date: Wed, 25 Feb 2009 01:45:56 +0000 (-0700) Subject: imsm: verify single sector mpb checksums X-Git-Tag: mdadm-3.0-devel3~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecf45690f2f4316b308eca3fd54af78a7c945726;p=thirdparty%2Fmdadm.git imsm: verify single sector mpb checksums If the mpb is only one sector do not skip the checksum verification. Signed-off-by: Dan Williams --- diff --git a/super-intel.c b/super-intel.c index 388ada1a..3f83255a 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1779,6 +1779,17 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname) sectors = mpb_sectors(anchor) - 1; free(anchor); if (!sectors) { + check_sum = __gen_imsm_checksum(super->anchor); + if (check_sum != __le32_to_cpu(super->anchor->check_sum)) { + if (devname) + fprintf(stderr, + Name ": IMSM checksum %x != %x on %s\n", + check_sum, + __le32_to_cpu(super->anchor->check_sum), + devname); + return 2; + } + rc = load_imsm_disk(fd, super, devname, 0); if (rc == 0) rc = parse_raid_devices(super);