]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't instantiate null dentries for snapped namespace
authorSage Weil <sage@newdream.net>
Tue, 21 Sep 2010 02:59:00 +0000 (19:59 -0700)
committerSage Weil <sage@newdream.net>
Tue, 21 Sep 2010 20:53:29 +0000 (13:53 -0700)
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.

src/mds/MDCache.cc

index 0141c7b73850a830b09d91e4fc8fd8528e9150dc..83b41eaa7e48219d1d2e1f0a560183791690972e 100644 (file)
@@ -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);