Skip to content

Commit

Permalink
MDEV-17810: Improve error printout when decryption fails or we identi…
Browse files Browse the repository at this point in the history
…fy page as both encrypted and unencrypted

fil_space_verify_crypt_checksum
	Print out both stored checksum and calculated checksums
	for encrypted page and unencrypted page asumptions.
  • Loading branch information
Jan Lindström committed Nov 29, 2018
1 parent 33fdb44 commit b4d102e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions storage/innobase/fil/fil0crypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ fil_space_verify_crypt_checksum(
return (true);
}

uint32 cchecksum1, cchecksum2;
uint32_t cchecksum1, cchecksum2;

/* Calculate checksums */
if (page_size.is_compressed()) {
Expand Down Expand Up @@ -2652,10 +2652,19 @@ fil_space_verify_crypt_checksum(
#else /* UNIV_INNOCHECKSUM */
ib::error()
<< " Page " << space << ":" << offset
<< " may be corrupted."
" Post encryption checksum " << checksum
<< " stored [" << checksum1 << ":" << checksum2
<< " may be corrupted.";
ib::info()
<< "If encrypted: stored checksum" << checksum
<< " calculated checksum [" << cchecksum1 << ":" << cchecksum2
<< "] key_version " << key_version;
ib::info()
<< "If unencrypted: stored checksum [" << checksum1
<< ":" << checksum2 << "] calculated crc32 ["
<< buf_calc_page_crc32(page, false) << ":"
<< buf_calc_page_crc32(page, true) << "] innodb ["
<< buf_calc_page_old_checksum(page) << ":"
<< buf_calc_page_new_checksum(page) << "] LSN "
<< mach_read_from_4(page + FIL_PAGE_LSN);
#endif
encrypted = false;
}
Expand Down

0 comments on commit b4d102e

Please sign in to comment.