]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't croak on null dentries in cache during reconnect/rejoin
authorSage Weil <sage@newdream.net>
Mon, 15 Feb 2010 19:40:20 +0000 (11:40 -0800)
committerSage Weil <sage@newdream.net>
Mon, 15 Feb 2010 19:40:20 +0000 (11:40 -0800)
They're created when we replay unlink events from the log.

src/mds/MDCache.cc

index 307eaba1d95232ccb269ecfaf0b91fc3bef92000..dc73cb970f63715f3835dfc3497cd08963108b03 100644 (file)
@@ -3308,7 +3308,8 @@ bool MDCache::parallel_fetch_traverse_dir(inodeno_t ino, filepath& path,
     frag_t fg = cur->pick_dirfrag(path[i]);
     CDir *dir = cur->get_or_open_dirfrag(this, fg);
     CDentry *dn = dir->lookup(path[i]);
-    if (!dn) {
+    CDentry::linkage_t *dnl = dn->get_linkage();
+    if (!dn || dnl->is_null()) {
       if (!dir->is_complete()) {
        // fetch dir
        fetch_queue.insert(dir);
@@ -3321,7 +3322,6 @@ bool MDCache::parallel_fetch_traverse_dir(inodeno_t ino, filepath& path,
        return true;
       }
     }
-    CDentry::linkage_t *dnl = dn->get_linkage();
     cur = dnl->get_inode();
     if (!cur) {
       assert(dnl->is_remote());
@@ -5997,10 +5997,12 @@ bool MDCache::path_is_mine(filepath& path)
     dout(15) << "path_is_mine seg " << i << ": " << path[i] << " under " << *cur << dendl;
     frag_t fg = cur->pick_dirfrag(path[i]);
     CDir *dir = cur->get_dirfrag(fg);
-    if (!dir) return cur->is_auth();
+    if (!dir)
+      return cur->is_auth();
     CDentry *dn = dir->lookup(path[i]);
-    if (!dn) return dir->is_auth();
     CDentry::linkage_t *dnl = dn->get_linkage();
+    if (!dn || dnl->is_null())
+      return dir->is_auth();
     assert(dnl->is_primary());
     cur = dnl->get_inode();
   }