]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: add lba nodes' logical begin addresses to extent_info_t 44361/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Mon, 20 Dec 2021 06:37:52 +0000 (14:37 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Mon, 20 Dec 2021 06:39:57 +0000 (14:39 +0800)
LBAManager rely on lba nodes' logical start addresses to judge whether an lba extent
is still live

Fixes: https://tracker.ceph.com/issues/53612
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc
src/crimson/os/seastore/seastore_types.h

index 2813864375629b4414849127fdec2d45b0a85c39..a2781090edb5fcf7bbef27b16db917205aa0ccb9 100644 (file)
@@ -996,7 +996,9 @@ record_t Cache::prepare_record(Transaction &t)
        i->get_type(),
        i->is_logical()
        ? i->cast<LogicalCachedExtent>()->get_laddr()
-       : L_ADDR_NULL,
+       : (is_lba_node(i->get_type())
+         ? i->cast<lba_manager::btree::LBANode>()->get_node_meta().begin
+         : L_ADDR_NULL),
        std::move(bl)
       });
   }
index 11d23f8bfc0d7c7e799a46cab8f39d84c7fbd39d..fd2b8c7d01784af4d87c9f6405b13bb8d8b823a9 100644 (file)
@@ -185,12 +185,6 @@ BtreeLBAManager::alloc_extent(
     });
 }
 
-static bool is_lba_node(extent_types_t type)
-{
-  return type == extent_types_t::LADDR_INTERNAL ||
-    type == extent_types_t::LADDR_LEAF;
-}
-
 static bool is_lba_node(const CachedExtent &e)
 {
   return is_lba_node(e.get_type());
index c3c803e425e88ae7dfb8dd415f52527e104073ea..b205b77089e8ea219e371e2811bbb0e5da6829d8 100644 (file)
@@ -779,6 +779,12 @@ constexpr bool is_logical_type(extent_types_t type) {
   }
 }
 
+constexpr bool is_lba_node(extent_types_t type)
+{
+  return type == extent_types_t::LADDR_INTERNAL ||
+    type == extent_types_t::LADDR_LEAF;
+}
+
 std::ostream &operator<<(std::ostream &out, extent_types_t t);
 
 /* description of a new physical extent */