From: Patrick Donnelly Date: Tue, 18 Feb 2025 19:35:16 +0000 (-0500) Subject: client: skip unexpected command replies X-Git-Tag: v19.2.3~288^2~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e91a2d04c4625b2b6620cfd48cea5ec0f4f74346;p=ceph.git client: skip unexpected command replies Instead of marking the message as handled, give another component (or Client) a chance to process. Signed-off-by: Patrick Donnelly (cherry picked from commit 616fdd1ae394195a2628fef6f6808e035b71069d) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index ef8a640a9e854..d0d60a2735c3a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3116,8 +3116,11 @@ Dispatcher::dispatch_result_t Client::ms_dispatch2(const MessageRef &m) break; case MSG_COMMAND_REPLY: if (m->get_source().type() == CEPH_ENTITY_TYPE_MDS) { - handle_command_reply(ref_cast(m)); - return Dispatcher::HANDLED(); + if (handle_command_reply(ref_cast(m))) { + return Dispatcher::HANDLED(); + } else { + return Dispatcher::UNHANDLED(); + } } else { return Dispatcher::UNHANDLED(); } @@ -6676,7 +6679,7 @@ int Client::mds_command( return 0; } -void Client::handle_command_reply(const MConstRef& m) +bool Client::handle_command_reply(const MConstRef& m) { ceph_tid_t const tid = m->get_tid(); @@ -6685,7 +6688,7 @@ void Client::handle_command_reply(const MConstRef& m) std::scoped_lock cmd_lock(command_lock); if (!command_table.exists(tid)) { ldout(cct, 1) << __func__ << ": unknown tid " << tid << ", dropping" << dendl; - return; + return false; } auto &op = command_table.get_command(tid); @@ -6726,6 +6729,7 @@ void Client::handle_command_reply(const MConstRef& m) } command_table.erase(tid); + return true; } // ------------------- diff --git a/src/client/Client.h b/src/client/Client.h index 76b9a1d8ea4ec..3c26b0a86c224 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -980,7 +980,7 @@ protected: void set_cap_epoch_barrier(epoch_t e); - void handle_command_reply(const MConstRef& m); + bool handle_command_reply(const MConstRef& m); int fetch_fsmap(bool user); int resolve_mds( const std::string &mds_spec,