From dbfe087f3033058b1e7800bca577ddc0278ec775 Mon Sep 17 00:00:00 2001 From: sepia-liu Date: Sat, 30 May 2020 18:10:15 +0800 Subject: [PATCH] client: fix directory inode can not call release callback 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 (cherry picked from commit 60de0363ec7e1423665091bf42f67b78f11d9c1f) --- src/client/Client.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 52e818482a04a..c08187ae852f0 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4381,10 +4381,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()); } } } -- 2.39.5