From: Xiubo Li Date: Thu, 2 Mar 2023 14:01:08 +0000 (+0800) Subject: mds: add the revoking caps back to _revokes list X-Git-Tag: v19.0.0~995^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0454c449132abd1499d671990d680bd0794abc5a;p=ceph.git 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 --- diff --git a/src/mds/Capability.cc b/src/mds/Capability.cc index 5103b240e52..471ee79bfee 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)