]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/lba_manager/btree: fix get_val() paddr value from iterator
authorSamuel Just <sjust@redhat.com>
Fri, 27 Aug 2021 05:42:38 +0000 (05:42 +0000)
committerSamuel Just <sjust@redhat.com>
Sat, 28 Aug 2021 04:57:04 +0000 (04:57 +0000)
This was causing a stray RETIRED_PLACEHOLDER to be created resulting in
a segment cleaner segfault in release on an invalid segment and a crash
upon adding a duplicate lba btree pin since the returned addr didn't
match the addr of the INITIAL_PENDING extent on the transaction.

Fixes: https://tracker.ceph.com/issues/52434
Fixes: https://tracker.ceph.com/issues/52435
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/lba_manager/btree/lba_btree.h

index 887d58a8c566bc2aa89a36f7ebdca5fd26d7a157..3f22467e64d54b382409d4037bff02069ec1068d 100644 (file)
@@ -75,7 +75,9 @@ public:
     }
     lba_map_val_t get_val() const {
       assert(!is_end());
-      return leaf.node->iter_idx(leaf.pos).get_val();
+      auto ret = leaf.node->iter_idx(leaf.pos).get_val();
+      ret.paddr = ret.paddr.maybe_relative_to(leaf.node->get_paddr());
+      return ret;
     }
 
     bool is_end() const {
@@ -93,10 +95,12 @@ public:
 
     LBAPinRef get_pin() const {
       assert(!is_end());
+      auto val = get_val();
+      auto key = get_key();
       return std::make_unique<BtreeLBAPin>(
        leaf.node,
-       get_val().paddr.maybe_relative_to(leaf.node->get_paddr()),
-       lba_node_meta_t{ get_key(), get_key() + get_val().len, 0 });
+       val.paddr,
+       lba_node_meta_t{ key, key + val.len, 0 });
     }
 
   private: