From: Yingxin Cheng Date: Tue, 20 Aug 2024 01:26:15 +0000 (+0800) Subject: crimson/os/seastore/cache: extents added to dirty must be fully loaded X-Git-Tag: v20.0.0~1175^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f7e4f0daa25e2f78eacfd4da36342398037d89ea;p=ceph.git crimson/os/seastore/cache: extents added to dirty must be fully loaded Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 6b8f81d2ed7c..beda4ac509e8 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -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++);