From: Xuehan Xu Date: Wed, 11 Feb 2026 06:50:27 +0000 (+0800) Subject: crimson/os/seastore: correct the exception condition when merging X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=57019f91dea307b3c704ce2392a5f854512b5900;p=ceph-ci.git crimson/os/seastore: correct the exception condition when merging rewritten fixed kv nodes Fixes: https://tracker.ceph.com/issues/74798 Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/btree/fixed_kv_node.h b/src/crimson/os/seastore/btree/fixed_kv_node.h index fdd67e49656..22531d933a2 100644 --- a/src/crimson/os/seastore/btree/fixed_kv_node.h +++ b/src/crimson/os/seastore/btree/fixed_kv_node.h @@ -526,8 +526,8 @@ struct FixedKVInternalNode auto it = pending_version.begin(); while (it != pending_version.end() && iter != this->end()) { if (auto child = pending_version.children[it->get_offset()]; - (is_valid_child_ptr(child) && - (pending_version.is_pending() || child->_is_pending_io()))) { + is_valid_child_ptr(child) && child->_is_pending_io()) { + // skip the ones that the pending version is also modifying it++; continue; } diff --git a/src/crimson/os/seastore/lba/lba_btree_node.h b/src/crimson/os/seastore/lba/lba_btree_node.h index 7944b8f6cec..c0faa45b880 100644 --- a/src/crimson/os/seastore/lba/lba_btree_node.h +++ b/src/crimson/os/seastore/lba/lba_btree_node.h @@ -295,19 +295,25 @@ struct LBALeafNode auto &pending_version = static_cast(*copy_dest); auto it = pending_version.begin(); while (it != pending_version.end() && iter != this->end()) { - if (iter->get_val().pladdr.is_laddr() || - iter->get_val().pladdr.get_paddr().is_zero()) { + const auto &v1 = iter->get_val(); + if (v1.pladdr.is_laddr() || + v1.pladdr.get_paddr().is_zero()) { iter++; continue; } + if (const auto &v2 = it->get_val(); + v2.pladdr.is_laddr() || v2.pladdr.get_paddr().is_zero()) { + it++; + continue; + } if (auto child = pending_version.children[it->get_offset()]; - is_valid_child_ptr(child) && - (pending_version.is_pending() || child->_is_pending_io())) { + is_valid_child_ptr(child) && child->_is_pending_io()) { + // skip the ones that the pending version is also modifying it++; continue; } if (it->get_key() == iter->get_key()) { - it->set_val(iter->get_val()); + it->set_val(v1); it++; iter++; } else if (it->get_key() > iter->get_key()) { @@ -330,7 +336,7 @@ struct LBALeafNode #ifndef NDEBUG for (auto ©_dest : copy_dests.dests_by_key) { auto &pending_version = static_cast(*copy_dest); - ceph_assert(pending_version.is_pending()); + assert(pending_version.is_pending()); } #endif this->merge_content_to(t, copy_dests.dests_by_key);