summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-07-16 09:37:58 +0800
committerYan, Zheng <zheng.z.yan@intel.com>2013-08-05 11:09:07 +0800
commit755581977c2bc9eb81c9d9d955024cbedded2161 (patch)
treedd47113ff56cdbdab1a1c797cc87af104950963e
parent9797986697622217cb03b3420a70a49eddb6b02d (diff)
downloadceph-755581977c2bc9eb81c9d9d955024cbedded2161.tar.gz
mds: fix cap revoke confirmation
There are several issues in the Capability::confirm_receipt() 1. when receiving a client caps message with 'seq == last_sent', it doesn't mean we finish revoking caps. The client can send caps message that only flushes dirty metadata. 2. When receiving a client caps message with 'seq == N', we should forget pending revocations whose seq numbers are less than N. This is because, when revoking caps, we create a revoke_info structure and set its seq number to 'last_sent', then increase the 'last_sent'. 3. When client actively releases caps (by request), the code only works for the 'seq == last_sent' case. If there are pending revocations, we should update them as if the release message is received before we revoke the corresponding caps. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r--src/mds/Capability.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mds/Capability.h b/src/mds/Capability.h
index fdecb9090b3..fb6b3dc1f16 100644
--- a/src/mds/Capability.h
+++ b/src/mds/Capability.h
@@ -171,14 +171,16 @@ public:
}
void confirm_receipt(ceph_seq_t seq, unsigned caps) {
if (seq == last_sent) {
- _pending = caps;
_revokes.clear();
_issued = caps;
+ // don't add bits
+ _pending &= caps;
} else {
// can i forget any revocations?
- while (!_revokes.empty() &&
- _revokes.front().seq <= seq)
+ while (!_revokes.empty() && _revokes.front().seq < seq)
_revokes.pop_front();
+ if (!_revokes.empty() && _revokes.front().seq == seq)
+ _revokes.begin()->before = caps;
_calc_issued();
}
//check_rdcaps_list();