]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: release revoking Fc after invalidate cache
authorYan, Zheng <zyan@redhat.com>
Thu, 11 Jan 2018 08:22:12 +0000 (16:22 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 11 Jan 2018 08:31:58 +0000 (16:31 +0800)
this issue is likely revealed by commit 7bc1fa04
"client: avoid adding checked inode to the delayed_caps"

Fixes: http://tracker.ceph.com/issues/22652
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/client/Client.cc

index 4c296f76aba0bad328550c52dfa668683883a441..75de6d89d483220a4d62f4c43f2590bfc2876224 100644 (file)
@@ -3384,8 +3384,10 @@ void Client::check_caps(Inode *in, unsigned flags)
     return;   // guard if at end of func
 
   if ((revoking & (CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO)) &&
-      (used & CEPH_CAP_FILE_CACHE) && !(used & CEPH_CAP_FILE_BUFFER))
-    _release(in);
+      (used & CEPH_CAP_FILE_CACHE) && !(used & CEPH_CAP_FILE_BUFFER)) {
+    if (_release(in))
+      used &= ~CEPH_CAP_FILE_CACHE;
+  }
 
   if (!in->cap_snaps.empty())
     flush_snaps(in);
@@ -3710,8 +3712,11 @@ void Client::_invalidate_inode_cache(Inode *in)
   ldout(cct, 10) << "_invalidate_inode_cache " << *in << dendl;
 
   // invalidate our userspace inode cache
-  if (cct->_conf->client_oc)
+  if (cct->_conf->client_oc) {
     objectcacher->release_set(&in->oset);
+    if (!objectcacher->set_is_empty(&in->oset))
+      lderr(cct) << "failed to invalidate cache for " << *in << dendl;
+  }
 
   _schedule_invalidate_callback(in, 0, 0);
 }