]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix directory inode can not call release callback 36177/head
authorsepia-liu <liuwei_coder@163.com>
Sat, 30 May 2020 10:10:15 +0000 (18:10 +0800)
committerNathan Cutler <ncutler@suse.com>
Sat, 18 Jul 2020 17:26:11 +0000 (19:26 +0200)
When use client like nfs-ganesha hold ref of dir inode,
the dentry of the inode does not expirable because its
state is always lru_pinned.

The current code location does not tell nfs-ganesha to
release dir inodes, so we should call release_callback
to tell nfs-ganesha release first, and then trim dentry
when its state becomes unpin.

Fixes: https://tracker.ceph.com/issues/46355
Signed-off-by: sepia-liu <liuwei_coder@163.com>
(cherry picked from commit 60de0363ec7e1423665091bf42f67b78f11d9c1f)

src/client/Client.cc

index 3a02b72c2ba2903bcabbc392709a594aef68787a..52f8a4a2446e732f865eccf55d3fdfa41fddec40 100644 (file)
@@ -4348,10 +4348,12 @@ void Client::trim_caps(MetaSession *s, uint64_t max)
          all = false;
         }
       }
+      if (in->ll_ref == 1 && in->ino != MDS_INO_ROOT) {
+         _schedule_ino_release_callback(in.get());
+      }
       if (all && in->ino != MDS_INO_ROOT) {
         ldout(cct, 20) << __func__ << " counting as trimmed: " << *in << dendl;
        trimmed++;
-       _schedule_ino_release_callback(in.get());
       }
     }
   }