]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mdcache: in trim_non_auth, only print out path if it has a parent dentry.
authorGreg Farnum <gregf@hq.newdream.net>
Tue, 23 Nov 2010 22:40:54 +0000 (14:40 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Tue, 23 Nov 2010 22:40:54 +0000 (14:40 -0800)
This should only occur with the root inode, but caused a segfault for
anybody running more than one MDS who restarted.

Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
src/mds/MDCache.cc

index 5265a1d047d7649aacb637fbe3547cfa9cdb6b04..9f67469ccd8a09c9c6eef00a4d26449b901d28fd 100644 (file)
@@ -5203,7 +5203,8 @@ void MDCache::trim_non_auth()
          in->close_dirfrag((*p)->dirfrag().frag);
        }
        dout(0) << " ... " << *in << dendl;
-       warn_string_dirs << in->get_parent_dn()->get_name() << std::endl;
+       if (in->get_parent_dn())
+         warn_string_dirs << in->get_parent_dn()->get_name() << std::endl;
        assert(in->get_num_ref() == 0);
        remove_inode(in);
       }