From 02cc17d76c9099603e3331b216807c032a3ad821 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Tue, 1 Apr 2025 12:04:09 +0200 Subject: [PATCH] mds: MDCache request cleanup handles potential null mdr 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 (cherry picked from commit e63f8cc54d03dbdd147cdd2c301adef119a640da) --- src/mds/MDCache.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 66071d385db..d3c8e8a4927 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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()) { -- 2.47.3