From: Shen, Hang Date: Thu, 26 Aug 2021 06:09:45 +0000 (+0800) Subject: mds: avoid adding null dentry to bloom filter X-Git-Tag: v18.0.0~1394^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6a74b8ec14cf631e6e2c2250b4d6466a47eb0da;p=ceph.git mds: avoid adding null dentry to bloom filter Signed-off-by: "Shen, Hang" --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index eaa8b6339f9..eb0bc7e645a 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6913,7 +6913,7 @@ bool MDCache::trim_dentry(CDentry *dn, expiremap& expiremap) // directory completeness. // (check this _before_ we unlink the inode, below!) bool clear_complete = false; - if (!(dnl->is_null() && dn->is_clean())) + if (dn->is_auth() && !(dnl->is_null() && dn->is_clean())) clear_complete = true; // unlink the dentry @@ -6951,13 +6951,14 @@ bool MDCache::trim_dentry(CDentry *dn, expiremap& expiremap) } } + if (clear_complete) { + if (dn->last == CEPH_NOSNAP) + dir->add_to_bloom(dn); + dir->state_clear(CDir::STATE_COMPLETE); + } + // remove dentry - if (dn->last == CEPH_NOSNAP && dir->is_auth()) - dir->add_to_bloom(dn); dir->remove_dentry(dn); - - if (clear_complete) - dir->state_clear(CDir::STATE_COMPLETE); if (mds->logger) mds->logger->inc(l_mds_inodes_expired); return false;