From c3f6bfb507109d015752f91bed93b68bbf862316 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 bf3c626aa249..ee5018cdca1a 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2337,6 +2337,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 e8e24e87a940..4a72662e0c79 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -2808,6 +2808,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.47.3