]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: fix "stopping mds can't export subtree" 17689/head
authorYan, Zheng <zyan@redhat.com>
Wed, 13 Sep 2017 03:27:18 +0000 (11:27 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 13 Sep 2017 03:40:37 +0000 (11:40 +0800)
caused by commit
790c34138f "Make standby-replay mds avoid initiating subtree export"

Fixes: http://tracker.ceph.com/issues/21378
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/MDCache.cc
src/mds/Migrator.cc

index a02ddb937dfa5be94e9a423ea34775f8b33b9882..ba9ecc361a16d2d9f1731b2327cdcb106b1ca8d6 100644 (file)
@@ -6498,7 +6498,8 @@ bool MDCache::trim(int max, int count)
       if (!diri->is_auth() && !diri->is_base() &&
          dir->get_num_head_items() == 0) {
        if (dir->state_test(CDir::STATE_EXPORTING) ||
-           dir->is_freezing() || dir->is_frozen() || !mds->is_active())
+           !(mds->is_active() || mds->is_stopping()) ||
+           dir->is_freezing() || dir->is_frozen())
          continue;
 
        migrator->export_empty_import(dir);
index 382fb703a7073da2df0ba49ae11849bfb4cc0467..b10bc3bd5604fef8da610e0ef383051259c232dc 100644 (file)
@@ -776,6 +776,10 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest)
   assert(dir->is_auth());
   assert(dest != mds->get_nodeid());
    
+  if (!(mds->is_active() || mds->is_stopping())) {
+    dout(7) << "i'm not active, no exports for now" << dendl;
+    return;
+  }
   if (mds->mdcache->is_readonly()) {
     dout(7) << "read-only FS, no exports for now" << dendl;
     return;
@@ -793,10 +797,6 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest)
     //ceph_abort();
     return;
   }
-  if (!mds->is_active()) {
-    dout(7) << "i'm not active, no exports for now" << dendl;
-    return;
-  }
 
   if (!dir->inode->is_base() && dir->inode->get_projected_parent_dir()->inode->is_stray() &&
       dir->inode->get_projected_parent_dir()->get_parent_dir()->ino() != MDS_INO_MDSDIR(dest)) {