Commit 7f64f82e authored by marko's avatar marko

branches/zip: buf0lru.c: Improve debug assertions.

buf_LRU_block_free_non_file_page(): ut_ad(block) before dereferencing block.

buf_LRU_block_remove_hashed_page(): Forbid buf_pool_mutex_exit() while
calling buf_buddy_free().  Callers of buf_LRU_block_remove_hashed_page()
assume that the buffer pool mutex will not be released and reacquired.
parent b59d325e
......@@ -1567,9 +1567,9 @@ buf_LRU_block_free_non_file_page(
{
void* data;
ut_ad(block);
ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(&block->mutex));
ut_ad(block);
switch (buf_block_get_state(block)) {
case BUF_BLOCK_MEMORY:
......@@ -1789,7 +1789,9 @@ buf_LRU_block_remove_hashed_page(
bpage->zip.data = NULL;
mutex_exit(&((buf_block_t*) bpage)->mutex);
buf_pool_mutex_exit_forbid();
buf_buddy_free(data, page_zip_get_size(&bpage->zip));
buf_pool_mutex_exit_allow();
mutex_enter(&((buf_block_t*) bpage)->mutex);
page_zip_set_size(&bpage->zip, 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment