summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/fil0crypt.h
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-05-17 14:14:16 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2015-05-18 13:28:13 +0300
commit20c23048c1d2f28942f2f99e4150a58b6545c0cd (patch)
tree8d2b19158162640172a4ddf0fc553f94a7162878 /storage/xtradb/include/fil0crypt.h
parent476dfb16034f1af4c99e683fd612eec16ab1661a (diff)
downloadmariadb-git-20c23048c1d2f28942f2f99e4150a58b6545c0cd.tar.gz
MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
Analysis: Problem was that tablespaces not encrypted might not have crypt_data stored on disk. Fixed by always creating crypt_data to memory cache of the tablespace. MDEV-8138: strange results from encrypt-and-grep test Analysis: crypt_data->type is not updated correctly on memory cache. This caused problem with state tranfer on encrypted => unencrypted => encrypted. Fixed by updating memory cache of crypt_data->type correctly based on current srv_encrypt_tables value to either CRYPT_SCHEME_1 or CRYPT_SCHEME_UNENCRYPTED.
Diffstat (limited to 'storage/xtradb/include/fil0crypt.h')
-rw-r--r--storage/xtradb/include/fil0crypt.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/storage/xtradb/include/fil0crypt.h b/storage/xtradb/include/fil0crypt.h
index 70f67daa2d2..6dedd9c7f65 100644
--- a/storage/xtradb/include/fil0crypt.h
+++ b/storage/xtradb/include/fil0crypt.h
@@ -128,7 +128,7 @@ Get crypt data for a space*/
UNIV_INTERN
fil_space_crypt_t *
fil_space_get_crypt_data(
-/*======================*/
+/*=====================*/
ulint space); /*!< in: tablespace id */
/*********************************************************************
@@ -136,15 +136,16 @@ Set crypt data for a space*/
UNIV_INTERN
void
fil_space_set_crypt_data(
-/*======================*/
+/*=====================*/
ulint space, /*!< in: tablespace id */
fil_space_crypt_t* crypt_data); /*!< in: crypt data to set */
/*********************************************************************
Merge crypt data */
+UNIV_INTERN
void
fil_space_merge_crypt_data(
-/*======================*/
+/*=======================*/
fil_space_crypt_t* dst_crypt_data, /*!< in: crypt_data */
const fil_space_crypt_t* src_crypt_data); /*!< in: crypt data */
@@ -175,7 +176,7 @@ Clear crypt data from page 0 (used for import tablespace) */
UNIV_INTERN
void
fil_space_clear_crypt_data(
-/*======================*/
+/*=======================*/
byte* page, /*!< in: buffer page */
ulint offset); /*!< in: offset where crypt data is stored */
@@ -194,7 +195,7 @@ Check if extra buffer shall be allocated for decrypting after read */
UNIV_INTERN
bool
fil_space_check_encryption_read(
-/*==============================*/
+/*============================*/
ulint space); /*!< in: tablespace id */
/*********************************************************************
@@ -202,7 +203,7 @@ Check if page shall be encrypted before write */
UNIV_INTERN
bool
fil_space_check_encryption_write(
-/*==============================*/
+/*=============================*/
ulint space); /*!< in: tablespace id */
/*********************************************************************
@@ -210,7 +211,7 @@ Encrypt buffer page */
UNIV_INTERN
void
fil_space_encrypt(
-/*===============*/
+/*==============*/
ulint space, /*!< in: tablespace id */
ulint offset, /*!< in: page no */
lsn_t lsn, /*!< in: page lsn */
@@ -223,7 +224,7 @@ Decrypt buffer page */
UNIV_INTERN
void
fil_space_decrypt(
-/*===============*/
+/*==============*/
ulint space, /*!< in: tablespace id */
const byte* src_frame,/*!< in: page frame */
ulint page_size, /*!< in: size of data to encrypt */
@@ -236,7 +237,7 @@ Decrypt buffer page
UNIV_INTERN
bool
fil_space_decrypt(
-/*===============*/
+/*==============*/
fil_space_crypt_t* crypt_data, /*!< in: crypt data */
const byte* src_frame,/*!< in: page frame */
ulint page_size, /*!< in: page size */
@@ -250,7 +251,7 @@ as it modifies srv_checksum_algorithm (temporarily)
UNIV_INTERN
bool
fil_space_verify_crypt_checksum(
-/*===============*/
+/*============================*/
const byte* src_frame,/*!< in: page frame */
ulint zip_size); /*!< in: size of data to encrypt */
@@ -285,7 +286,7 @@ Set rotate key age */
UNIV_INTERN
void
fil_crypt_set_rotate_key_age(
-/*=====================*/
+/*=========================*/
uint rotate_age); /*!< in: requested rotate age */
/*********************************************************************
@@ -293,7 +294,7 @@ Set rotation threads iops */
UNIV_INTERN
void
fil_crypt_set_rotation_iops(
-/*=====================*/
+/*========================*/
uint iops); /*!< in: requested iops */
/*********************************************************************
@@ -301,7 +302,7 @@ Mark a space as closing */
UNIV_INTERN
void
fil_space_crypt_mark_space_closing(
-/*===============*/
+/*===============================*/
ulint space); /*!< in: tablespace id */
/*********************************************************************
@@ -309,7 +310,7 @@ Wait for crypt threads to stop accessing space */
UNIV_INTERN
void
fil_space_crypt_close_tablespace(
-/*===============*/
+/*=============================*/
ulint space); /*!< in: tablespace id */
/** Struct for retreiving info about encryption */
@@ -331,7 +332,7 @@ Get crypt status for a space
UNIV_INTERN
int
fil_space_crypt_get_status(
-/*==================*/
+/*=======================*/
ulint id, /*!< in: space id */
struct fil_space_crypt_status_t * status); /*!< out: status */
@@ -370,10 +371,18 @@ Get scrub status for a space
UNIV_INTERN
int
fil_space_get_scrub_status(
-/*==================*/
+/*=======================*/
ulint id, /*!< in: space id */
struct fil_space_scrub_status_t * status); /*!< out: status */
+/*********************************************************************
+Adjust encrypt tables */
+UNIV_INTERN
+void
+fil_crypt_set_encrypt_tables(
+/*=========================*/
+ uint val); /*!< in: New srv_encrypt_tables setting */
+
#ifndef UNIV_NONINL
#include "fil0crypt.ic"
#endif