From f9e51c2f0da46202d83ca0ff87625efad3773a51 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 10 Sep 2021 21:11:24 -0700 Subject: [PATCH] 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 --- src/crimson/os/seastore/transaction_manager.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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(), -- 2.39.5