From: Xiubo Li Date: Tue, 23 Aug 2022 07:53:20 +0000 (+0800) Subject: mds: remove the cap directly when releasing the cap X-Git-Tag: v19.0.0~1231^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9fbde6da076f2d7c8bfde50c3f9e581e967c0df0;p=ceph.git mds: remove the cap directly when releasing the cap In case: mds client - Releases cap and put Inode - Increase cap->seq and sends revokes req to the client - Receives release req and - Receives & drops the revoke req skip removing the cap and then eval the CInode and issue or revoke caps again. - Receives & drops the caps update or revoke req - Health warning for client isn't responding to mclientcaps(revoke) Fixes: https://tracker.ceph.com/issues/57244 Signed-off-by: Xiubo Li --- diff --git a/src/mds/Capability.h b/src/mds/Capability.h index 3fd6d2ce6d4f..27ab15de05b8 100644 --- a/src/mds/Capability.h +++ b/src/mds/Capability.h @@ -183,24 +183,6 @@ public: return last_sent; } int confirm_receipt(ceph_seq_t seq, unsigned caps); - // we may get a release racing with revocations, which means our revokes will be ignored - // by the client. clean them out of our _revokes history so we don't wait on them. - void clean_revoke_from(ceph_seq_t li) { - bool changed = false; - while (!_revokes.empty() && _revokes.front().last_issue <= li) { - _revokes.pop_front(); - changed = true; - } - if (changed) { - bool was_revoking = (_issued & ~_pending); - calc_issued(); - if (was_revoking && _issued == _pending) { - item_revoking_caps.remove_myself(); - item_client_revoking_caps.remove_myself(); - maybe_clear_notable(); - } - } - } ceph_seq_t get_mseq() const { return mseq; } void inc_mseq() { mseq++; } diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index a66ab75dfa28..7030274d5567 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -4066,13 +4066,6 @@ void Locker::_do_cap_release(client_t client, inodeno_t ino, uint64_t cap_id, new C_Locker_RetryCapRelease(this, client, ino, cap_id, mseq, seq)); return; } - if (seq != cap->get_last_issue()) { - dout(7) << " issue_seq " << seq << " != " << cap->get_last_issue() << dendl; - // clean out any old revoke history - cap->clean_revoke_from(seq); - eval_cap_gather(in); - return; - } remove_client_cap(in, cap); }