]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix cap revoke confirmation 1676/head
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 16 Apr 2014 05:35:39 +0000 (13:35 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Wed, 16 Apr 2014 05:51:04 +0000 (13:51 +0800)
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 <zheng.z.yan@intel.com>
src/mds/Capability.h

index c105a38fe13ded74ce1bafde1701696965d6e0ea..3d976487161628315aa32e420edd31f39a92d1cc 100644 (file)
@@ -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();
   }