]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/lba: fix wrong asserts and "if" conditions 69067/head
authorXuehan Xu <xuxuehan@qianxin.com>
Sat, 23 May 2026 09:23:02 +0000 (17:23 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Sun, 24 May 2026 07:31:26 +0000 (15:31 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/lba/lba_btree_node.h

index c42be7c1ba8817a0eb3b8d1f1293e44cc07959ba..bd8deb37b7f073413132667d7f4e09bf8451adb7 100644 (file)
@@ -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);