summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/fil/fil0crypt.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 4aace91d51a..8102e1d6238 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1530,12 +1530,19 @@ static bool fil_crypt_find_space_to_rotate(
key_state->key_version != 0);
bool wake = true;
- while (state->space && !state->should_shutdown()) {
+ while (state->space) {
if (state->space == fil_system.temp_space) {
wake = false;
goto done;
}
+ if (state->should_shutdown()) {
+ state->space->release();
+done:
+ state->space = nullptr;
+ break;
+ }
+
mysql_mutex_unlock(&fil_crypt_threads_mutex);
/* If there is no crypt data and we have not yet read
page 0 for this tablespace, we need to read it before
@@ -1558,12 +1565,6 @@ static bool fil_crypt_find_space_to_rotate(
mysql_mutex_lock(&fil_crypt_threads_mutex);
}
- if (state->space) {
- state->space->release();
-done:
- state->space = NULL;
- }
-
/* no work to do; release our allocation of I/O capacity */
fil_crypt_return_iops(state, wake);
return true;