From 7f5bd004b35e2a1b60f4951e8a70646f0ad08b3f Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 21 Jun 2017 11:42:22 +0800 Subject: [PATCH] mds: don't call StrayManager::eval_stray() for undefined inode Signed-off-by: "Yan, Zheng" --- src/mds/MDCache.cc | 4 +++- src/mds/StrayManager.cc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 8ed3a720020..1c6936823bc 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 25c2477441e..b2102ddc2d0 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 -- 2.39.5