From 0640a0853477e4e79f59c2c30ead4b029a8e1d12 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 16 Apr 2014 13:35:39 +0800 Subject: [PATCH] mds: fix cap revoke confirmation when the _revokes list is emptied, it doesn't mean that client has released the revoking caps. It's possible that client was flusing dirty metadata. Signed-off-by: Yan, Zheng --- src/mds/Capability.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/mds/Capability.h b/src/mds/Capability.h index c105a38fe13d..3d9764871616 100644 --- a/src/mds/Capability.h +++ b/src/mds/Capability.h @@ -137,15 +137,7 @@ private: public: int pending() { return _pending; } - int issued() { - if (0) { - //#warning capability debug sanity check, remove me someday - unsigned o = _issued; - _calc_issued(); - assert(o == _issued); - } - return _issued; - } + int issued() { return _issued; } bool is_null() { return !_pending && _revokes.empty(); } ceph_seq_t issue(unsigned c) { @@ -192,9 +184,14 @@ public: // can i forget any revocations? while (!_revokes.empty() && _revokes.front().seq < seq) _revokes.pop_front(); - if (!_revokes.empty() && _revokes.front().seq == seq) - _revokes.begin()->before = caps; - _calc_issued(); + if (!_revokes.empty()) { + if (_revokes.front().seq == seq) + _revokes.begin()->before = caps; + _calc_issued(); + } else { + // seq < last_sent + _issued = caps | _pending; + } } //check_rdcaps_list(); } -- 2.47.3