diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 22994e389c9..64ca9e6fff6 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1237,11 +1237,10 @@ void log_t::clear_mmap() noexcept #ifdef HAVE_PMEM if (!is_opened()) { - latch.wr_lock(SRW_LOCK_CALL); + ut_d(latch.wr_lock(SRW_LOCK_CALL)); ut_ad(!resize_in_progress()); ut_ad(get_lsn() == get_flushed_lsn(std::memory_order_relaxed)); - buf_size= unsigned(std::min(capacity(), buf_size_max)); - latch.wr_unlock(); + ut_d(latch.wr_unlock()); return; } #endif diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 30b99ea0bc7..4162f60fee5 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -4590,7 +4590,10 @@ inline void log_t::set_recovered() noexcept } #ifdef HAVE_PMEM else + { + buf_size= unsigned(std::min(capacity(), buf_size_max)); mprotect(buf, size_t(file_size), PROT_READ | PROT_WRITE); + } #endif }