]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't call StrayManager::eval_stray() for undefined inode
authorYan, Zheng <zyan@redhat.com>
Wed, 21 Jun 2017 03:42:22 +0000 (11:42 +0800)
committerJohn Spray <john.spray@redhat.com>
Fri, 23 Jun 2017 16:07:33 +0000 (17:07 +0100)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/MDCache.cc
src/mds/StrayManager.cc

index 8ed3a7200208154870b5f2af6a61deadf76b1e93..1c6936823bcb0a61592c6dbf9655785ce2d13d6e 100644 (file)
@@ -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)) {
index 25c2477441eaacfa7f7fc282ecd886c584d3203f..b2102ddc2d09b6cbb717e4e09a8a347e1edfa52c 100644 (file)
@@ -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