From: Yan, Zheng Date: Mon, 4 May 2015 07:01:42 +0000 (+0800) Subject: mds: only add head dentry to bloom filter X-Git-Tag: v9.0.2~178^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb484b68e79982e31d90fceaf2e0e20f1cdfaf0e;p=ceph.git mds: only add head dentry to bloom filter bloom filter can't handle range covered by snap dentry. Signed-off-by: Yan, Zheng --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index f17740eb79dc..211b8b0226c0 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 98ce2f9646e8..f58e2cab0342 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?