]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add the revoking caps back to _revokes list
authorXiubo Li <xiubli@redhat.com>
Thu, 2 Mar 2023 14:01:08 +0000 (22:01 +0800)
committerXiubo Li <xiubli@redhat.com>
Fri, 13 Oct 2023 00:38:37 +0000 (08:38 +0800)
When revoking caps from clients and if the clients could release
some of the caps references and the clients still could send cap
update request back to MDS, while the confirm_receipt() will clear
the _revokes list anyway.

But this cap will still be kept in revoking_caps list.

At the same time add one debug log when revocation is not totally
finished.

Fixes: https://tracker.ceph.com/issues/57244
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 0454c449132abd1499d671990d680bd0794abc5a)

src/mds/Capability.cc

index 5103b240e529d51f84be43f24adceb4be633fc96..471ee79bfeeb8b8c0bb7b565379a8af3d47e0d66 100644 (file)
 
 #include "common/Formatter.h"
 
+#define dout_context g_ceph_context
+#define dout_subsys ceph_subsys_mds
+#undef dout_prefix
+#define dout_prefix *_dout << "Capability "
+
 
 /*
  * Capability::Export
@@ -183,6 +188,16 @@ int Capability::confirm_receipt(ceph_seq_t seq, unsigned caps) {
     _issued = caps;
     // don't add bits
     _pending &= caps;
+
+    // if the revoking is not totally finished just add the
+    // new revoking caps back.
+    if (was_revoking && revoking()) {
+      CInode *in = get_inode();
+      dout(10) << "revocation is not totally finished yet on " << *in
+               << ", the session " << *session << dendl;
+      _revokes.emplace_back(_pending, last_sent, last_issue);
+      calc_issued();
+    }
   } else {
     // can i forget any revocations?
     while (!_revokes.empty() && _revokes.front().seq < seq)