From: Samuel Just Date: Sat, 11 Sep 2021 04:11:24 +0000 (-0700) Subject: crimson/os/seastore/transaction_manager: fix delayed alloc addr in rewrite_logical_extent X-Git-Tag: v17.1.0~889^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9e51c2f0da46202d83ca0ff87625efad3773a51;p=ceph.git crimson/os/seastore/transaction_manager: fix delayed alloc addr in rewrite_logical_extent 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 --- diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index df14ed2fb2a..bdb2d5aa68b 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -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(),