Skip to content

Commit 75cd8c0

Browse files
committed
mds: MDCache: check validity of mdr requests before dispatching
Ignore null requests Signed-off-by: Abhishek Lekshmanan <[email protected]>
1 parent e63f8cc commit 75cd8c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/mds/MDCache.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10021,6 +10021,10 @@ void MDCache::request_forward(const MDRequestRef& mdr, mds_rank_t who, int port)
1002110021

1002210022
void MDCache::dispatch_request(const MDRequestRef& mdr)
1002310023
{
10024+
if (!mdr) {
10025+
dout(0) << __func__ << ": received a null request!" << dendl;
10026+
return;
10027+
}
1002410028
if (mdr->dead) {
1002510029
dout(20) << __func__ << ": dead " << *mdr << dendl;
1002610030
return;
@@ -13334,7 +13338,9 @@ int MDCache::dump_cache(std::string_view fn, Formatter *f, double timeout)
1333413338
void C_MDS_RetryRequest::finish(int r)
1333513339
{
1333613340
mdr->retry++;
13337-
cache->dispatch_request(mdr);
13341+
if (mdr) {
13342+
cache->dispatch_request(mdr);
13343+
}
1333813344
}
1333913345

1334013346
MDSContext *CF_MDS_RetryRequestFactory::build()

0 commit comments

Comments
 (0)