]> git.apps.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)
committerPrashant D <pdhange@redhat.com>
Wed, 17 Jan 2018 01:43:52 +0000 (20:43 -0500)
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>
(cherry picked from commit e05f14319a69224077b3aec52be6c2964eb40731)

src/client/Client.cc

index f73100545654e5919ddebe3560d4d04706f155d2..1e1d9df5b2a6d7186d230dcb7f9546dbb24bd449 100644 (file)
@@ -3335,8 +3335,10 @@ void Client::check_caps(Inode *in, bool is_delayed)
     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);
@@ -3664,8 +3666,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);
 }