From 845f3f7fe87f916836fc5e14f45895b7b32fbc5a Mon Sep 17 00:00:00 2001 From: Kongming Wu Date: Tue, 26 Jan 2016 10:45:52 +0800 Subject: [PATCH] mds:judgment added to avoid the risk of visting the NULL pointer Signed-off-by: chenyehua11692 chen.yehua@h3c.com --- src/mds/MDCache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3