]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: only add head dentry to bloom filter
authorYan, Zheng <zyan@redhat.com>
Mon, 4 May 2015 07:01:42 +0000 (15:01 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 5 May 2015 08:57:43 +0000 (16:57 +0800)
bloom filter can't handle range covered by snap dentry.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/CDir.cc
src/mds/MDCache.cc

index f17740eb79dc92cf651dac65bceef7d3a2f2e300..211b8b0226c0605ee8dc9b737833e80438288436 100644 (file)
@@ -629,6 +629,7 @@ void CDir::unlink_inode_work( CDentry *dn )
 
 void CDir::add_to_bloom(CDentry *dn)
 {
+  assert(dn->last == CEPH_NOSNAP);
   if (!bloom) {
     /* not create bloom filter for incomplete dir that was added by log replay */
     if (!is_complete())
index 98ce2f9646e838af3fcbfed74afef5f66b9336b3..f58e2cab0342292d0ca6af1cae790aaeb55000ab 100644 (file)
@@ -6397,7 +6397,7 @@ bool MDCache::trim_dentry(CDentry *dn, map<mds_rank_t, MCacheExpire*>& expiremap
   }
 
   // remove dentry
-  if (dir->is_auth())
+  if (dn->last == CEPH_NOSNAP && dir->is_auth())
     dir->add_to_bloom(dn);
   dir->remove_dentry(dn);
 
@@ -7786,8 +7786,10 @@ int MDCache::path_traverse(MDRequestRef& mdr, Message *req, MDSInternalContextBa
 
     if (curdir->is_auth()) {
       // dentry is mine.
-      if (curdir->is_complete() || (curdir->has_bloom() &&
-          !curdir->is_in_bloom(path[depth]))){
+      if (curdir->is_complete() ||
+         (snapid == CEPH_NOSNAP &&
+          curdir->has_bloom() &&
+          !curdir->is_in_bloom(path[depth]))){
         // file not found
        if (pdnvec) {
          // instantiate a null dn?