]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: drop dirty/flushing caps if auth MDS' session is reset
authorYan, Zheng <zheng.z.yan@intel.com>
Fri, 11 Apr 2014 07:34:25 +0000 (15:34 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sun, 27 Apr 2014 13:40:06 +0000 (21:40 +0800)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/client/Client.cc

index 47d1c1d4620b4225fb5334753ef9c4ecc9957338..b3c4b7628ee724e749c34ebfafbf29bdecbd5c3d 100644 (file)
@@ -3075,12 +3075,27 @@ void Client::remove_all_caps(Inode *in)
     remove_cap(in->caps.begin()->second, true);
 }
 
-void Client::remove_session_caps(MetaSession *mds) 
+void Client::remove_session_caps(MetaSession *s)
 {
-  while (mds->caps.size()) {
-    Cap *cap = *mds->caps.begin();
+  ldout(cct, 10) << "remove_session_caps mds." << s->mds_num << dendl;
+
+  while (s->caps.size()) {
+    Cap *cap = *s->caps.begin();
+    Inode *in = cap->inode;
+    int dirty_caps = 0;
+    if (in->auth_cap == cap)
+      dirty_caps = in->dirty_caps | in->flushing_caps;
     remove_cap(cap, false);
+    if (dirty_caps) {
+      lderr(cct) << "remove_session_caps still has dirty|flushing caps on " << *in << dendl;
+      if (in->flushing_caps)
+       num_flushing_caps--;
+      in->flushing_caps = 0;
+      in->dirty_caps = 0;
+      put_inode(in);
+    }
   }
+  sync_cond.Signal();
 }
 
 void Client::trim_caps(MetaSession *s, int max)