From: Ilya Dryomov Date: Thu, 13 May 2021 11:11:57 +0000 (+0200) Subject: librbd/cache/pwl/ssd: set m_bytes_allocated_cap on recovery X-Git-Tag: v16.2.7~50^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3003c556e54299e5f9a4a9358789302d62566538;p=ceph.git librbd/cache/pwl/ssd: set m_bytes_allocated_cap on recovery Currently it's set only when a new cache is formatted. Signed-off-by: Ilya Dryomov (cherry picked from commit cb9b3afd87a28e96d3688e1c73900d8043fac6cc) --- diff --git a/src/librbd/cache/pwl/ssd/WriteLog.cc b/src/librbd/cache/pwl/ssd/WriteLog.cc index 208c191d2386..ff77dad1dc1e 100644 --- a/src/librbd/cache/pwl/ssd/WriteLog.cc +++ b/src/librbd/cache/pwl/ssd/WriteLog.cc @@ -215,6 +215,9 @@ void WriteLog::load_existing_entries(pwl::DeferredContexts &later) { this->m_first_valid_entry = pool_root.first_valid_entry; this->m_first_free_entry = pool_root.first_free_entry; + this->m_bytes_allocated_cap = + this->m_log_pool_size - DATA_RING_BUFFER_OFFSET; + std::map> sync_point_entries; std::map missing_sync_points;