From: Patrick Donnelly Date: Thu, 16 Dec 2021 15:44:40 +0000 (-0500) Subject: mds: trigger stray reintegration when loading dentry X-Git-Tag: v16.2.8~240^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3077dadee4031118afbd773ad2cc4ce64a5aa2c5;p=ceph.git mds: trigger stray reintegration when loading dentry During recursive scrub, the MDS will load a remote dentry into cache but not necessarily check if reintegration is necessary. Before this commit, it would only happen when the dentry is returned from a client request. To effect global reintegration when there are too many strays, this means a cluster admin would have to do `find` on the CephFS file system. This is unsavory because of the cache / cap explosion involved. Fixes: https://tracker.ceph.com/issues/53641 Signed-off-by: Patrick Donnelly (cherry picked from commit 83f9a49dfddcba06ab3e0cd9b860523fafad4605) --- diff --git a/src/mds/CDentry.cc b/src/mds/CDentry.cc index 7d8170f73167..f0825d7fe118 100644 --- a/src/mds/CDentry.cc +++ b/src/mds/CDentry.cc @@ -252,6 +252,9 @@ void CDentry::link_remote(CDentry::linkage_t *dnl, CInode *in) if (dnl == &linkage) in->add_remote_parent(this); + + // check for reintegration + dir->mdcache->eval_remote(this); } void CDentry::unlink_remote(CDentry::linkage_t *dnl)