From a39c9b01c5193289dca172a3868faf1180ee6015 Mon Sep 17 00:00:00 2001 From: Alex Ainscow Date: Fri, 3 Oct 2025 14:55:56 +0100 Subject: [PATCH] osdc: Interface to submit IO with ASIO Post. For direct read failures, the locking is such that we cannot immediately send a new IO without deadlocking. This new interface allows an op to be sent as an asio post. Signed-off-by: Alex Ainscow --- src/osdc/Objecter.cc | 7 +++++++ src/osdc/Objecter.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 392ef0f2863..961ced06f4a 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2319,6 +2319,13 @@ void Objecter::resend_mon_ops() // read | write --------------------------- + +void Objecter::op_post_submit(Op* op) { + boost::asio::post(service, [this, op]() { + op_submit(op); + }); +} + void Objecter::op_submit(Op *op, ceph_tid_t *ptid, int *ctx_budget) { shunique_lock rl(rwlock, ceph::acquire_shared); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 509c5ed7a31..38759be4cf2 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -2813,6 +2813,7 @@ private: int *ctx_budget = NULL); // public interface public: + void op_post_submit(Op *op); void op_submit(Op *op, ceph_tid_t *ptid = NULL, int *ctx_budget = NULL); bool is_active() { std::shared_lock l(rwlock); -- 2.39.5