From: Danny Al-Gaaf Date: Tue, 17 Mar 2015 17:18:34 +0000 (+0100) Subject: mds/MDCache.cc: fix potential null pointer dereference X-Git-Tag: v9.0.1~128^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35f61a30dc9d3e376c2b506ce26695416ebbf9fd;p=ceph.git mds/MDCache.cc: fix potential null pointer dereference Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index bcda25159d9b..f9e5a48e85c3 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6935,7 +6935,6 @@ void MDCache::handle_cache_expire(MCacheExpire *m) ++it) { CDir *dir = get_dirfrag(it->first); unsigned nonce = it->second; - dout(20) << __func__ << ": expiring dirfrag " << *dir << dendl; if (!dir) { CInode *diri = get_inode(it->first.ino); @@ -6967,8 +6966,10 @@ void MDCache::handle_cache_expire(MCacheExpire *m) << ", don't have it" << dendl; assert(dir); } + dout(20) << __func__ << ": expiring dirfrag " << *dir << dendl; + assert(dir->is_auth()); - + // check nonce if (nonce == dir->get_replica_nonce(from)) { // remove from our cached_by