From: Yan, Zheng Date: Wed, 16 Apr 2014 05:35:39 +0000 (+0800) Subject: mds: fix cap revoke confirmation X-Git-Tag: v0.80-rc1~22^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0640a0853477e4e79f59c2c30ead4b029a8e1d12;p=ceph.git 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 --- diff --git a/src/mds/Capability.h b/src/mds/Capability.h index c105a38fe13de..3d97648716162 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(); }