]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: MDCache request cleanup handles potential null mdr
authorAbhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
Tue, 1 Apr 2025 10:04:09 +0000 (12:04 +0200)
committerJos Collin <jcollin@redhat.com>
Tue, 2 Dec 2025 01:56:59 +0000 (07:26 +0530)
In cases where there is a single element in a batch_op_map,new_batch_head
is a nullptr, when this is retried at Finisher we'd hit one of the asserts when
dereferencing

Fixes: https://tracker.ceph.com/issues/70769
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
(cherry picked from commit e63f8cc54d03dbdd147cdd2c301adef119a640da)

src/mds/MDCache.cc

index 66071d385db1f32c65327b7f023b19e5e548414d..d3c8e8a49277a8186524326a8beacc0088a8ca8c 100644 (file)
@@ -9916,8 +9916,9 @@ void MDCache::request_cleanup(const MDRequestRef& mdr)
     auto new_batch_head = it->second->find_new_head();
     if (!new_batch_head) {
       mdr->batch_op_map->erase(it);
+    } else {
+      mds->finisher->queue(new C_MDS_RetryRequest(this, new_batch_head));
     }
-    mds->finisher->queue(new C_MDS_RetryRequest(this, new_batch_head));
   }
 
   if (mdr->has_more()) {