]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: extents added to dirty must be fully loaded
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 20 Aug 2024 01:26:15 +0000 (09:26 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 22 Aug 2024 02:49:07 +0000 (10:49 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.cc

index 6b8f81d2ed7cd36f8e7ec46502c8c13f864216da..beda4ac509e818bb8598328014dc6ee3134ac52c 100644 (file)
@@ -750,6 +750,7 @@ void Cache::add_to_dirty(CachedExtentRef ref)
   assert(ref->is_dirty());
   assert(!ref->primary_ref_list_hook.is_linked());
   ceph_assert(ref->get_modify_time() != NULL_TIME);
+  assert(ref->is_fully_loaded());
 
   // Note: next might not be at extent_state_t::DIRTY,
   // also see CachedExtent::is_stable_writting()
@@ -762,6 +763,7 @@ void Cache::remove_from_dirty(CachedExtentRef ref)
 {
   assert(ref->is_dirty());
   ceph_assert(ref->primary_ref_list_hook.is_linked());
+  assert(ref->is_fully_loaded());
 
   stats.dirty_bytes -= ref->get_length();
   dirty.erase(dirty.s_iterator_to(*ref));
@@ -774,12 +776,14 @@ void Cache::replace_dirty(
 {
   assert(prev->is_dirty());
   ceph_assert(prev->primary_ref_list_hook.is_linked());
+  assert(prev->is_fully_loaded());
 
   // Note: next might not be at extent_state_t::DIRTY,
   // also see CachedExtent::is_stable_writting()
   assert(next->is_dirty());
   assert(!next->primary_ref_list_hook.is_linked());
   ceph_assert(next->get_modify_time() != NULL_TIME);
+  assert(next->is_fully_loaded());
 
   assert(prev->get_dirty_from() == next->get_dirty_from());
   assert(prev->get_length() == next->get_length());
@@ -799,6 +803,7 @@ void Cache::clear_dirty()
     auto ptr = &*i;
     assert(ptr->is_dirty());
     ceph_assert(ptr->primary_ref_list_hook.is_linked());
+    assert(ptr->is_fully_loaded());
 
     stats.dirty_bytes -= ptr->get_length();
     dirty.erase(i++);