From 17e4f240d76a785a11a38e5a4b3aa555f9b7583b Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 13 Feb 2024 15:58:19 -0500 Subject: [PATCH] mds: avoid killing dead requests This is important when you have: * sub-op A finishes and resumes parent * parent kills all sub-ops (including sub-op A) Signed-off-by: Patrick Donnelly (cherry picked from commit b72e153d2b36956e97b8686aeb6aaacffe928750) --- src/mds/MDCache.cc | 4 +++- src/mds/Mutation.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 38df8e3b03e3f..179c461f8072b 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -9864,6 +9864,8 @@ void MDCache::request_cleanup(const MDRequestRef& mdr) { dout(15) << "request_cleanup " << *mdr << dendl; + mdr->dead = true; + if (mdr->has_more()) { if (mdr->more()->is_ambiguous_auth) mdr->clear_ambiguous_auth(); @@ -9904,7 +9906,7 @@ void MDCache::request_cleanup(const MDRequestRef& mdr) void MDCache::request_kill(const MDRequestRef& mdr) { - if (mdr->killed) { + if (mdr->killed || mdr->dead) { /* ignore duplicate kills */ return; } diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index a8a89e1ef3ffa..6e51275fbc157 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -277,6 +277,7 @@ public: bool committing = false; bool aborted = false; bool killed = false; + bool dead = false; // for applying projected inode changes std::set projected_nodes; -- 2.39.5