From: Sage Weil Date: Tue, 21 Sep 2010 02:59:00 +0000 (-0700) Subject: mds: don't instantiate null dentries for snapped namespace X-Git-Tag: v0.22~143^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa277aef7bb4c8ec31963e40114546b2377d65b4;p=ceph.git mds: don't instantiate null dentries for snapped namespace The dentry needs a [first,last] range and we don't know what first is when we miss a lookup. And part of the point of instantiating null dentires is to issue leases against them, which we don't do. The client will cache the null result. --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 0141c7b73850..83b41eaa7e48 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6008,12 +6008,14 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, // who if (dn) { dout(20) << " had null " << *dn << dendl; assert(dnl->is_null()); - } else if (!curdir->is_frozen()) { + } else if (curdir->is_frozen()) { + dout(20) << " not adding null to frozen dir " << dendl; + } else if (snapid < CEPH_MAXSNAP) { + dout(20) << " not adding null for snapid " << snapid << dendl; + } else { // create a null dentry dn = curdir->add_null_dentry(path[depth]); dout(20) << " added null " << *dn << dendl; - } else { - dout(20) << " not adding null to frozen dir " << dendl; } if (dn) pdnvec->push_back(dn);