From c8b1e564e7bb66240b8dbc9b8c7bb795163dbabe Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Tue, 7 Dec 2021 11:36:23 +0800 Subject: [PATCH] client: fix possible inifinite loop when getting an ESTALE from MDS In the MDS side, when one inode is under purging or couldn't find in all the peer MDSes, it will return ESTALE error. So retrying it makes no sense in any other MDS. Or the client will be inifinite loop retrying. Fixes: https://tracker.ceph.com/issues/53504 Signed-off-by: Xiubo Li (cherry picked from commit aabd5e9c578c2c6da9542bcb935bc36678503359) --- src/client/Client.cc | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 1250249b65c0..6ffcfdbe1d5d 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -2496,25 +2496,6 @@ void Client::handle_client_reply(const MConstRef& reply) return; } - if (-CEPHFS_ESTALE == reply->get_result()) { // see if we can get to proper MDS - ldout(cct, 20) << "got ESTALE on tid " << request->tid - << " from mds." << request->mds << dendl; - request->send_to_auth = true; - request->resend_mds = choose_target_mds(request); - Inode *in = request->inode(); - std::map::const_iterator it; - if (request->resend_mds >= 0 && - request->resend_mds == request->mds && - (in == NULL || - (it = in->caps.find(request->resend_mds)) != in->caps.end() || - request->sent_on_mseq == it->second.mseq)) { - ldout(cct, 20) << "have to return ESTALE" << dendl; - } else { - request->caller_cond->notify_all(); - return; - } - } - ceph_assert(!request->reply); request->reply = reply; insert_trace(request, session); -- 2.47.3