From d8652de61647ae19ad0f3ec90fad00930cdd5afd Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 23 Nov 2010 14:40:54 -0800 Subject: [PATCH] mdcache: in trim_non_auth, only print out path if it has a parent dentry. 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 --- src/mds/MDCache.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 5265a1d047d76..9f67469ccd8a0 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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); } -- 2.39.5