From e300501cc928de93dc1c93ca269415ffff590ca2 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Fri, 23 Jun 2023 22:44:23 +0800 Subject: [PATCH] mds: remove calculating caps after adding revokes back The calc_issued() makes no sense and will blindly set the 'issued' to the 'pending', which is incorrect. For the cap update msg it will pass the client's 'implemented' caps to MDS, and MDS will use the 'implemented' to calculate the 'issued' and 'pending' members and also will adjust the revoke list. The confirm_receipt() has already correctly calculating the 'issued' and 'pending' members. And after add the cap back to the revoke list we should mark it notable, which will move the cap object to the front of session list. Fixes: https://tracker.ceph.com/issues/61781 Signed-off-by: Xiubo Li (cherry picked from commit b6e2681ebd87ccbc964d0cb4758a26748d517fcf) --- src/mds/Capability.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/Capability.cc b/src/mds/Capability.cc index 471ee79bfeeb..de2a16e1ab19 100644 --- a/src/mds/Capability.cc +++ b/src/mds/Capability.cc @@ -196,7 +196,8 @@ int Capability::confirm_receipt(ceph_seq_t seq, unsigned caps) { dout(10) << "revocation is not totally finished yet on " << *in << ", the session " << *session << dendl; _revokes.emplace_back(_pending, last_sent, last_issue); - calc_issued(); + if (!is_notable()) + mark_notable(); } } else { // can i forget any revocations? -- 2.47.3