From: Kongming Wu Date: Tue, 26 Jan 2016 02:45:52 +0000 (+0800) Subject: mds:judgment added to avoid the risk of visting the NULL pointer X-Git-Tag: v10.0.4~172^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=845f3f7fe87f916836fc5e14f45895b7b32fbc5a;p=ceph.git mds:judgment added to avoid the risk of visting the NULL pointer Signed-off-by: chenyehua11692 chen.yehua@h3c.com --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index bcf7046c86a8..2c61fae0ab61 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7406,7 +7406,7 @@ bool MDCache::shutdown_pass() assert(subtrees.empty()); // Still replicas of mydir? - if (mydir->inode->is_replicated()) { + if ((mydir != NULL) && mydir->inode->is_replicated()) { // We do this because otherwise acks to locks could come in after // we cap the log. dout(7) << "waiting for mydir replicas to release: " << *mydir << dendl;