From: Yan, Zheng Date: Wed, 21 Jun 2017 03:42:22 +0000 (+0800) Subject: mds: don't call StrayManager::eval_stray() for undefined inode X-Git-Tag: ses5-milestone7~3^2~7^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f5bd004b35e2a1b60f4951e8a70646f0ad08b3f;p=ceph.git mds: don't call StrayManager::eval_stray() for undefined inode Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 8ed3a7200208..1c6936823bcb 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -12366,8 +12366,10 @@ void MDCache::activate_stray_manager() * away. */ void MDCache::maybe_eval_stray(CInode *in, bool delay) { - if (in->inode.nlink > 0 || in->is_base() || is_readonly() || mds->is_standby_replay()) + if (in->inode.nlink > 0 || in->is_base() || is_readonly() || + mds->get_state() <= MDSMap::STATE_REJOIN) return; + CDentry *dn = in->get_projected_parent_dn(); if (dn->state_test(CDentry::STATE_PURGING)) { diff --git a/src/mds/StrayManager.cc b/src/mds/StrayManager.cc index 25c2477441ea..b2102ddc2d09 100644 --- a/src/mds/StrayManager.cc +++ b/src/mds/StrayManager.cc @@ -420,6 +420,7 @@ bool StrayManager::_eval_stray(CDentry *dn, bool delay) dout(10) << " inode is " << *dnl->get_inode() << dendl; CInode *in = dnl->get_inode(); assert(in); + assert(!in->state_test(CInode::STATE_REJOINUNDEF)); // The only dentries elegible for purging are those // in the stray directories