]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix directory inode can not call release callback 35327/head
authorsepia-liu <liuwei_coder@163.com>
Sat, 30 May 2020 10:10:15 +0000 (18:10 +0800)
committersepia-liu <liuwei_coder@163.com>
Wed, 8 Jul 2020 06:09:08 +0000 (14:09 +0800)
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>
src/client/Client.cc

index e79b91857ef7cd3a53e694c84053a20cc54d4977..5fd521cc806304580a38e81b120f4f77716238cc 100644 (file)
@@ -4389,10 +4389,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());
       }
     }
   }