From fb484b68e79982e31d90fceaf2e0e20f1cdfaf0e Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 4 May 2015 15:01:42 +0800 Subject: [PATCH] mds: only add head dentry to bloom filter bloom filter can't handle range covered by snap dentry. Signed-off-by: Yan, Zheng --- src/mds/CDir.cc | 1 + src/mds/MDCache.cc | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index f17740eb79d..211b8b0226c 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -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()) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 98ce2f9646e..f58e2cab034 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6397,7 +6397,7 @@ bool MDCache::trim_dentry(CDentry *dn, map& 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? -- 2.47.3