summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-14 09:14:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-14 09:14:24 +0300
commit4849d94fe6bd918fd3dc6dc21424681a0ab5fa02 (patch)
tree05baa83f4eca6991554ebb4d206aea4c388a3bf4
parent06e9ce798c582ffb5a2f3cfbb0f8e33fe221feae (diff)
downloadmariadb-git-4849d94fe6bd918fd3dc6dc21424681a0ab5fa02.tar.gz
MDEV-28828 SIGSEGV in buf_flush_LRU_list_batch
In commit 73fee39ea62037780c59161507e89dd76c10b7a3 (MDEV-27985) a regression was introduced that would cause bpage=nullptr to be referenced. buf_flush_LRU_list_batch(): Always terminate the loop upon encountering a null pointer.
-rw-r--r--storage/innobase/buf/buf0flu.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index def598934c9..3d2669e2cc5 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -1294,7 +1294,6 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n)
n->flushed + n->evicted < max) ||
recv_recovery_is_on()); ++scanned)
{
- retry:
buf_page_t *prev= UT_LIST_GET_PREV(LRU, bpage);
const lsn_t oldest_modification= bpage->oldest_modification();
buf_pool.lru_hp.set(prev);
@@ -1326,7 +1325,6 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n)
mysql_mutex_lock(&buf_pool.mutex);
if (p.second)
buf_pool.stat.n_pages_written+= p.second;
- bpage= buf_pool.lru_hp.get();
goto retry;
}
else
@@ -1357,6 +1355,7 @@ reacquire_mutex:
else
/* Can't evict or dispatch this block. Go to previous. */
ut_ad(buf_pool.lru_hp.is_hp(prev));
+ retry:
bpage= buf_pool.lru_hp.get();
}