diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-02-25 02:45:56 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-02-25 02:45:56 +0100 |
commit | ecf45690f2f4316b308eca3fd54af78a7c945726 (patch) | |
tree | f050e91419b03176ed8a981d4c24a556e665681e /super-intel.c | |
parent | imsm: fix mark_failure / introduce mark_missing (diff) | |
download | mdadm-ecf45690f2f4316b308eca3fd54af78a7c945726.tar.xz mdadm-ecf45690f2f4316b308eca3fd54af78a7c945726.zip |
imsm: verify single sector mpb checksums
If the mpb is only one sector do not skip the checksum verification.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); |