From bebabced0a1ddad78689d24eab4864d49fc25c7b Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 13 Feb 2024 16:07:37 -0500 Subject: [PATCH] mds: finish request before completing internal req Importantly, this marks the request dead so it cannot be killed. Signed-off-by: Patrick Donnelly (cherry picked from commit c944eadaf6987a812e738459214872af1ff7678a) --- src/mds/Server.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 186882caed1..b27cd2bdbc2 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2083,10 +2083,11 @@ void Server::respond_to_request(const MDRequestRef& mdr, int r) } } else if (mdr->internal_op > -1) { dout(10) << __func__ << ": completing with result " << cpp_strerror(r) << " on internal " << *mdr << dendl; - if (!mdr->internal_op_finish) + auto c = mdr->internal_op_finish; + if (!c) ceph_abort_msg("trying to respond to internal op without finisher"); - mdr->internal_op_finish->complete(r); mdcache->request_finish(mdr); + c->complete(r); } } -- 2.39.5