]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/transaction_manager: fix delayed alloc addr in rewrite_logical_extent
authorSamuel Just <sjust@redhat.com>
Sat, 11 Sep 2021 04:11:24 +0000 (21:11 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 13 Sep 2021 23:37:17 +0000 (16:37 -0700)
Setting nlextent's to the addr of the original extent violates invariants
in the intrusive_set we're using for ExtentIndex and generally breaks the
assumption in cache that paddrs are unique until reuse.  This means we'll
do an extra update_mapping for now -- we can refactor SegmentCleaner to
avoid it later.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/transaction_manager.cc

index df14ed2fb2ad914e3a2c36b87f1f25accdfb5d85..bdb2d5aa68b7b4aa66eaa3ec3123815abeb370be 100644 (file)
@@ -324,11 +324,10 @@ TransactionManager::rewrite_logical_extent(
     *lextent,
     *nlextent);
 
-  if (need_delayed_allocation(extent->backend_type)) {
-    // hold old poffset for later mapping updating assert check
-    nlextent->set_paddr(lextent->get_paddr());
-    return rewrite_extent_iertr::now();
-  }
+  /* This update_mapping is, strictly speaking, unnecessary for delayed_alloc
+   * extents since we're going to do it again once we either do the ool write
+   * or allocate a relative inline addr.  TODO: refactor SegmentCleaner to
+   * avoid this complication. */
   return lba_manager->update_mapping(
     t,
     lextent->get_laddr(),