Skip to content

Commit b5ebfaf

Browse files
authored
Merge pull request ceph#62630 from theanalyst/batch-getattr-fixes
cephfs: MDCache request cleanup Reviewed-by: Venky Shankar <[email protected]>
2 parents 0666c09 + 75cd8c0 commit b5ebfaf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/mds/MDCache.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10071,6 +10071,10 @@ void MDCache::request_forward(const MDRequestRef& mdr, mds_rank_t who, int port)
1007110071

1007210072
void MDCache::dispatch_request(const MDRequestRef& mdr)
1007310073
{
10074+
if (!mdr) {
10075+
dout(0) << __func__ << ": received a null request!" << dendl;
10076+
return;
10077+
}
1007410078
if (mdr->dead) {
1007510079
dout(20) << __func__ << ": dead " << *mdr << dendl;
1007610080
return;
@@ -10140,8 +10144,9 @@ void MDCache::request_cleanup(const MDRequestRef& mdr)
1014010144
auto new_batch_head = it->second->find_new_head();
1014110145
if (!new_batch_head) {
1014210146
mdr->batch_op_map->erase(it);
10147+
} else {
10148+
mds->finisher->queue(new C_MDS_RetryRequest(this, new_batch_head));
1014310149
}
10144-
mds->finisher->queue(new C_MDS_RetryRequest(this, new_batch_head));
1014510150
}
1014610151

1014710152
if (mdr->has_more()) {
@@ -13387,7 +13392,9 @@ int MDCache::dump_cache(std::string_view fn, Formatter *f, double timeout)
1338713392
void C_MDS_RetryRequest::finish(int r)
1338813393
{
1338913394
mdr->retry++;
13390-
cache->dispatch_request(mdr);
13395+
if (mdr) {
13396+
cache->dispatch_request(mdr);
13397+
}
1339113398
}
1339213399

1339313400
MDSContext *CF_MDS_RetryRequestFactory::build()

0 commit comments

Comments
 (0)