From bb4fdf82530ed6946ae01ef4e29ad2071b56ef09 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 2 Mar 2023 22:01:08 +0800 Subject: [PATCH] mds: add the revoking caps back to _revokes list 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 --- src/mds/Capability.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mds/Capability.cc b/src/mds/Capability.cc index 5103b240e529..471ee79bfeeb 100644 --- a/src/mds/Capability.cc +++ b/src/mds/Capability.cc @@ -18,6 +18,11 @@ #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) -- 2.47.3