]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: MDCache: check validity of mdr requests before dispatching 66472/head
authorAbhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
Tue, 1 Apr 2025 10:07:56 +0000 (12:07 +0200)
committerJos Collin <jcollin@redhat.com>
Tue, 2 Dec 2025 01:56:59 +0000 (07:26 +0530)
Ignore null requests

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
(cherry picked from commit 75cd8c074f37de2a492177c54b3ef1879ab87637)

src/mds/MDCache.cc

index d3c8e8a49277a8186524326a8beacc0088a8ca8c..eb9ef46c29bf1744dc0fb434e530c75505d558a6 100644 (file)
@@ -9850,6 +9850,10 @@ void MDCache::request_forward(const MDRequestRef& mdr, mds_rank_t who, int port)
 
 void MDCache::dispatch_request(const MDRequestRef& mdr)
 {
+  if (!mdr) {
+    dout(0) << __func__ << ": received a null request!"  << dendl;
+    return;
+  }
   if (mdr->dead) {
     dout(20) << __func__ << ": dead " << *mdr << dendl;
     return;
@@ -13072,7 +13076,9 @@ int MDCache::dump_cache(std::string_view fn, Formatter *f, double timeout)
 void C_MDS_RetryRequest::finish(int r)
 {
   mdr->retry++;
-  cache->dispatch_request(mdr);
+  if (mdr) {
+    cache->dispatch_request(mdr);
+  }
 }
 
 MDSContext *CF_MDS_RetryRequestFactory::build()