]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/cache/pwl/ssd: set m_bytes_allocated_cap on recovery
authorIlya Dryomov <idryomov@gmail.com>
Thu, 13 May 2021 11:11:57 +0000 (13:11 +0200)
committerDeepika Upadhyay <dupadhya@redhat.com>
Fri, 5 Nov 2021 09:22:01 +0000 (14:52 +0530)
Currently it's set only when a new cache is formatted.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit cb9b3afd87a28e96d3688e1c73900d8043fac6cc)

src/librbd/cache/pwl/ssd/WriteLog.cc

index 208c191d238611a55ca122d1eedfcd368fe43d87..ff77dad1dc1e609354d696c934f43b4e9e63ae4d 100644 (file)
@@ -215,6 +215,9 @@ void WriteLog<I>::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<uint64_t, std::shared_ptr<SyncPointLogEntry>> sync_point_entries;
 
   std::map<uint64_t, bool> missing_sync_points;