From: Xuehan Xu Date: Thu, 18 Jun 2026 05:18:47 +0000 (+0800) Subject: crimson/os/seastore/transaction_manager: refresh the indirect_cursor X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ab6f707ced8c3dea32afffbb3ff8be1740adf31;p=ceph.git crimson/os/seastore/transaction_manager: refresh the indirect_cursor after removing the direct_cursor in _remove() Fixes: https://tracker.ceph.com/issues/77485 Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index f0e586220b9..9a66a80d3b8 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -331,6 +331,12 @@ TransactionManager::_remove( indirect_cursor = co_await lba_manager->update_mapping_refcount( t, mapping.indirect_cursor, -1); co_await mapping.direct_cursor->refresh(); + if (unlikely(indirect_cursor->get_key() == + mapping.direct_cursor->get_key())) { + // indirect_cursor points to the same mapping as direct_cursor, + // no need to keep it + indirect_cursor.reset(); + } } DEBUGT("removing direct mapping {}~0x{:x} refcount={} -- offset={}", @@ -345,6 +351,10 @@ TransactionManager::_remove( LBACursorRef direct_cursor = co_await lba_manager->update_mapping_refcount( t, mapping.direct_cursor, -1); + if (indirect_cursor) { + co_await indirect_cursor->refresh(); + } + auto ret = co_await resolve_cursor_to_mapping( t, indirect_cursor ? std::move(indirect_cursor) : std::move(direct_cursor)