[Commits] e3d8ca79251: Commit missed changes.

jan jan.lindstrom at mariadb.com
Tue Mar 21 15:12:39 EET 2017


revision-id: e3d8ca79251d651662861f741f2cc3460b5238ea (mariadb-10.2.4-77-ge3d8ca79251)
parent(s): 96e54280645b41c6c36f09eba5ce4c73ab1a672e
author: Jan Lindström
committer: Jan Lindström
timestamp: 2017-03-21 15:12:26 +0200
message:

Commit missed changes.

---
 storage/innobase/buf/buf0buf.cc   |  5 ++-
 storage/innobase/fil/fil0crypt.cc | 75 ++++++++++++++++++---------------------
 2 files changed, 36 insertions(+), 44 deletions(-)

diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e941836fa50..a3031ff9caa 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -5844,7 +5844,6 @@ buf_page_check_corrupt(
 	fil_space_t* space = fil_space_acquire_silent(space_id);
 	const page_size_t page_size(space->flags);
 	bool still_encrypted = false;
-	dberr_t err = DB_SUCCESS;
 	bool corrupted = false;
 	ulint page_type = mach_read_from_2(dst_frame + FIL_PAGE_TYPE);
 	fil_space_crypt_t* crypt_data = NULL;
@@ -5892,7 +5891,7 @@ buf_page_check_corrupt(
 
 	} else if (still_encrypted || (bpage->encrypted && corrupted)) {
 		bpage->encrypted = true;
-		err = DB_DECRYPTION_FAILED;
+		corrupted = true;
 
 		ib::error()
 			<< "Block in space_id " << space_id << " in file "
@@ -5915,7 +5914,7 @@ buf_page_check_corrupt(
 		fil_space_release(space);
 	}
 
-	return (err);
+	return (corrupted);
 }
 
 /********************************************************************//**
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 0695dfef078..f71676a8365 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -304,36 +304,32 @@ fil_space_read_crypt_data(
 	if (! (type == CRYPT_SCHEME_UNENCRYPTED ||
 	       type == CRYPT_SCHEME_1)) {
 
-		ib_logf(IB_LOG_LEVEL_ERROR,
-			"Found non sensible crypt scheme: " ULINTPF " for space " ULINTPF
-			" offset: " ULINTPF " bytes: "
-			"[ %.2x %.2x %.2x %.2x %.2x %.2x ].",
-			type, space, offset,
-			page[offset + 0 + MAGIC_SZ],
-			page[offset + 1 + MAGIC_SZ],
-			page[offset + 2 + MAGIC_SZ],
-			page[offset + 3 + MAGIC_SZ],
-			page[offset + 4 + MAGIC_SZ],
-			page[offset + 5 + MAGIC_SZ]);
-		ut_error;
+		ib::error() << "Found non sensible crypt scheme: "
+			    << type << "," << iv_length << " for space: "
+			    << space << " offset: "
+			    << offset << " bytes: ["
+			    << page[offset + 2 + MAGIC_SZ]
+			    << page[offset + 3 + MAGIC_SZ]
+			    << page[offset + 4 + MAGIC_SZ]
+			    << page[offset + 5 + MAGIC_SZ]
+			    << "].";
+		return NULL;
 	}
 
 	fil_space_crypt_t* crypt_data;
 	ulint iv_length = mach_read_from_1(page + offset + MAGIC_SZ + 1);
 
 	if (! (iv_length == sizeof(crypt_data->iv))) {
-		ib_logf(IB_LOG_LEVEL_ERROR,
-			"Found non sensible iv length: %lu for space %lu "
-			" offset: %lu type: %lu bytes: "
-			"[ %.2x %.2x %.2x %.2x %.2x %.2x ].",
-			iv_length, space, offset, type,
-			page[offset + 0 + MAGIC_SZ],
-			page[offset + 1 + MAGIC_SZ],
-			page[offset + 2 + MAGIC_SZ],
-			page[offset + 3 + MAGIC_SZ],
-			page[offset + 4 + MAGIC_SZ],
-			page[offset + 5 + MAGIC_SZ]);
-		ut_error;
+		ib::error() << "Found non sensible crypt scheme: "
+			    << type << "," << iv_length << " for space: "
+			    << space << " offset: "
+			    << offset << " bytes: ["
+			    << page[offset + 2 + MAGIC_SZ]
+			    << page[offset + 3 + MAGIC_SZ]
+			    << page[offset + 4 + MAGIC_SZ]
+			    << page[offset + 5 + MAGIC_SZ]
+			    << "].";
+		return NULL;
 	}
 
 	uint min_key_version = mach_read_from_4
@@ -569,10 +565,7 @@ fil_encrypt_buf(
 	uint key_version = fil_crypt_get_latest_key_version(crypt_data);
 
 	if (key_version == ENCRYPTION_KEY_VERSION_INVALID) {
-		ib_logf(IB_LOG_LEVEL_FATAL,
-			"Unknown key id %u. Can't continue!\n",
-			crypt_data->key_id);
-		ut_error;
+		ib::fatal() << "Unknown encryption key for key_id:" << crypt_data->key_id;
 	}
 
 	ulint orig_page_type = mach_read_from_2(src_frame+FIL_PAGE_TYPE);
@@ -818,13 +811,11 @@ fil_space_decrypt(
 			return false;
 		}
 
-		ib_logf(IB_LOG_LEVEL_FATAL,
-			"Unable to decrypt data-block "
-			" src: %p srclen: %ld buf: %p buflen: %d."
-			" return-code: %d. Can't continue!\n",
-			src, (long)srclen,
-			dst, dstlen, rc);
-		ut_error;
+		ib::fatal() << "Unable to decrypt data-block "
+			    << " src: " << src << "srclen: "
+			    << srclen << " buf: " << dst << "buflen: "
+			    << dstlen << " return-code: " << rc
+			    << " Can't continue!";
 	}
 
 	/* For compressed tables we do not store the FIL header because
@@ -2419,9 +2410,10 @@ fil_crypt_set_thread_cnt(
 			os_thread_id_t rotation_thread_id;
 			os_thread_create(fil_crypt_thread, NULL, &rotation_thread_id);
 
-			ib_logf(IB_LOG_LEVEL_INFO,
-				"Creating #%d thread id %lu total threads %u.",
-				i+1, os_thread_pf(rotation_thread_id), new_cnt);
+			ib::info() << "Creating "
+				   << i+1 << " encryption thread id "
+				   << os_thread_pf(rotation_thread_id)
+				   << " total threads " << new_cnt << ".";
 		}
 	} else if (new_cnt < srv_n_fil_crypt_threads) {
 		srv_n_fil_crypt_threads = new_cnt;
@@ -2553,9 +2545,10 @@ fil_space_crypt_close_tablespace(
 		time_t now = time(0);
 
 		if (now >= last + 30) {
-			ib_logf(IB_LOG_LEVEL_WARN,
-				"Waited %ld seconds to drop space: %s(" ULINTPF ").",
-				now - start, space->name, space->id);
+			ib::warn() << "Waited "
+				   << now - start
+				   << " seconds to drop space: "
+				   << space->name << ".";
 			last = now;
 		}
 	}


More information about the commits mailing list