]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove the cap directly when releasing the cap
authorXiubo Li <xiubli@redhat.com>
Tue, 23 Aug 2022 07:53:20 +0000 (15:53 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 8 Mar 2023 13:46:05 +0000 (21:46 +0800)
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 <xiubli@redhat.com>
src/mds/Capability.h
src/mds/Locker.cc

index 3fd6d2ce6d4f0d5924d839099098bd618da68dab..27ab15de05b81adf58c7abbd77f5a9423753726e 100644 (file)
@@ -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++; }
 
index a66ab75dfa28568b83564a57270f2f72399ce1dd..7030274d55673e498d79aa1e77deff9e86a856d5 100644 (file)
@@ -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);
 }