From: Xuehan Xu Date: Sat, 23 May 2026 09:23:02 +0000 (+0800) Subject: crimson/os/seastore/lba: fix wrong asserts and "if" conditions X-Git-Tag: v21.0.1~154^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F69067%2Fhead;p=ceph.git crimson/os/seastore/lba: fix wrong asserts and "if" conditions Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/lba/lba_btree_node.h b/src/crimson/os/seastore/lba/lba_btree_node.h index c42be7c1ba8..bd8deb37b7f 100644 --- a/src/crimson/os/seastore/lba/lba_btree_node.h +++ b/src/crimson/os/seastore/lba/lba_btree_node.h @@ -314,11 +314,14 @@ struct LBALeafNode t, it->get_key(), pending_version); ceph_abort(); } - if (is_valid_child_ptr(child) && - (child->_is_mutable() || child->_is_pending_io())) { - // skip the ones that the pending version is also modifying - it++; - continue; + if (is_valid_child_ptr(child)) { + if ((child->_is_mutable() || child->_is_pending_io())) { + // skip the ones that the pending version is also modifying + it++; + continue; + } else { + assert(child->_is_exist_clean() || child->_is_exist_mutation_pending()); + } } auto pending_key = it->get_key(); auto stable_key = iter->get_key(); @@ -328,9 +331,7 @@ struct LBALeafNode assert(pending_end <= stable_end); if (pending_key != stable_key) { assert(v2.pladdr != v1.pladdr); - assert(!is_valid_child_ptr(child) || - !child->_is_exist_clean() || - !child->_is_exist_mutation_pending()); + assert(is_valid_child_ptr(child)); } if (v2.pladdr != v1.pladdr) { auto m_v2 = v2; @@ -340,9 +341,7 @@ struct LBALeafNode m_v2.pladdr = paddr; SUBTRACET(seastore_lba, "merging to {}, paddr: {} -> {}", t, pending_version, m_v2.pladdr, paddr); - if (!is_valid_child_ptr(child) || - (!child->_is_exist_clean() && - !child->_is_exist_mutation_pending())) { + if (!is_valid_child_ptr(child)) { // exclude the mappings whose children are EXIST_CLEAN ones SUBTRACET(seastore_lba, "merging to {}, checksum: {} -> {}", t, pending_version, m_v2.checksum, v1.checksum);