]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: drop cap snaps when auth mds session gets closed 13579/head
authorYan, Zheng <zyan@redhat.com>
Wed, 22 Feb 2017 08:25:57 +0000 (16:25 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 22 Feb 2017 09:39:25 +0000 (17:39 +0800)
Fixes: http://tracker.ceph.com/issues/19022
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/client/Client.cc

index c52d97a25d15d7904325e41d4353283ec93b8fbe..be3d13e44679e40049c9454c3410a06f35562d58 100644 (file)
@@ -3908,8 +3908,9 @@ void Client::remove_session_caps(MetaSession *s)
   while (s->caps.size()) {
     Cap *cap = *s->caps.begin();
     Inode *in = cap->inode;
-    int dirty_caps = 0;
+    bool dirty_caps = false, cap_snaps = false;
     if (in->auth_cap == cap) {
+      cap_snaps = !in->cap_snaps.empty();
       dirty_caps = in->dirty_caps | in->flushing_caps;
       in->wanted_max_size = 0;
       in->requested_max_size = 0;
@@ -3917,6 +3918,10 @@ void Client::remove_session_caps(MetaSession *s)
     }
     remove_cap(cap, false);
     signal_cond_list(in->waitfor_caps);
+    if (cap_snaps) {
+      InodeRef tmp_ref(in);
+      in->cap_snaps.clear();
+    }
     if (dirty_caps) {
       lderr(cct) << "remove_session_caps still has dirty|flushing caps on " << *in << dendl;
       if (in->flushing_caps) {