From: Xuehan Xu Date: Mon, 22 Sep 2025 08:24:44 +0000 (+0800) Subject: crimson/osd/pg: create "submit_lock" unlocker before locking it X-Git-Tag: v21.0.0~209^2~74^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33172a1be6365c32e543a6c89e8e4d2c02246321;p=ceph.git crimson/osd/pg: create "submit_lock" unlocker before locking it Fixes: https://tracker.ceph.com/issues/73159 Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/osd/osd_operations/snaptrim_event.cc b/src/crimson/osd/osd_operations/snaptrim_event.cc index 1a4f67dd760..5128373ec85 100644 --- a/src/crimson/osd/osd_operations/snaptrim_event.cc +++ b/src/crimson/osd/osd_operations/snaptrim_event.cc @@ -420,12 +420,12 @@ SnapTrimObjSubEvent::start() auto all_completed = interruptor::now(); { - // as with PG::submit_executer, we need to build the pg log entries - // and submit the transaction atomically - co_await interruptor::make_interruptible(pg->submit_lock.lock()); auto unlocker = seastar::defer([this] { pg->submit_lock.unlock(); }); + // as with PG::submit_executer, we need to build the pg log entries + // and submit the transaction atomically + co_await interruptor::make_interruptible(pg->submit_lock.lock()); logger().debug("{}: calling remove_or_update obc={}", *this, obc_manager.get_obc()->get_oid()); diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index c7ae18d2f25..46e0c09dee8 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1064,12 +1064,12 @@ PG::interruptible_future PG::submit_error_log( const std::error_code e, ceph_tid_t rep_tid) { - // as with submit_executer, need to ensure that log numbering and submission - // are atomic - co_await interruptor::make_interruptible(submit_lock.lock()); auto unlocker = seastar::defer([this] { submit_lock.unlock(); }); + // as with submit_executer, need to ensure that log numbering and submission + // are atomic + co_await interruptor::make_interruptible(submit_lock.lock()); LOG_PREFIX(PG::submit_error_log); DEBUGDPP("{} rep_tid: {} error: {}", *this, *m, rep_tid, e); @@ -1202,12 +1202,12 @@ PG::submit_executer_fut PG::submit_executer( LOG_PREFIX(PG::submit_executer); DEBUGDPP("", *this); - // we need to build the pg log entries and submit the transaction - // atomically to ensure log ordering - co_await interruptor::make_interruptible(submit_lock.lock()); auto unlocker = seastar::defer([this] { submit_lock.unlock(); }); + // we need to build the pg log entries and submit the transaction + // atomically to ensure log ordering + co_await interruptor::make_interruptible(submit_lock.lock()); auto [submitted, completed] = co_await std::move( ox