]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use either dentry_invalidate_cb or remount_cb to invalidate kernel dcache 20960/head
authorZhi Zhang <willzzhang@tencent.com>
Mon, 5 Mar 2018 03:04:36 +0000 (11:04 +0800)
committerPrashant D <pdhange@redhat.com>
Mon, 19 Mar 2018 10:27:07 +0000 (06:27 -0400)
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
(cherry picked from commit 6b823dc250223c2c25c341d6ffcfa64510f47bb2)

src/client/Client.cc

index e0b0771893a322431506856a6329973be3dd63a3..102a1ae2bd5d22848df532613c0d6aa81b74d12a 100644 (file)
@@ -4064,12 +4064,14 @@ void Client::_invalidate_kernel_dcache()
 {
   if (unmounting)
     return;
-  if (can_invalidate_dentries && dentry_invalidate_cb && root->dir) {
-    for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir->dentries.begin();
-        p != root->dir->dentries.end();
-        ++p) {
-      if (p->second->inode)
-       _schedule_invalidate_dentry_callback(p->second, false);
+  if (can_invalidate_dentries) {
+    if (dentry_invalidate_cb && root->dir) {
+      for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir->dentries.begin();
+         p != root->dir->dentries.end();
+         ++p) {
+       if (p->second->inode)
+        _schedule_invalidate_dentry_callback(p->second, false);
+      }
     }
   } else if (remount_cb) {
     // Hacky: