]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid adding null dentry to bloom filter
authorShen, Hang <shenhang@kuaishou.com>
Thu, 26 Aug 2021 06:09:45 +0000 (14:09 +0800)
committershenhang <shenhang@kuaishou.com>
Wed, 9 Feb 2022 09:31:45 +0000 (17:31 +0800)
Signed-off-by: "Shen, Hang" <shenhang@kuaishou.com>
src/mds/MDCache.cc

index eaa8b6339f9742d07d51e21d963b8f1d2aa59b03..eb0bc7e645a0c83c98e912a197450f1e216e3a8c 100644 (file)
@@ -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;