]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: fix "stopping mds can't export subtree" 17714/head
authorYan, Zheng <zyan@redhat.com>
Wed, 13 Sep 2017 03:27:18 +0000 (11:27 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 14 Sep 2017 03:33:03 +0000 (20:33 -0700)
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>
(cherry picked from commit c294051987de1ff79540060a0563fa02c8f03f91)

src/mds/MDCache.cc
src/mds/Migrator.cc

index 0cf77a3f8c1b2d149c724027e5ed67733426e316..7e170ba4d830c67ab3d24b390b73683db90b55d9 100644 (file)
@@ -6522,7 +6522,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 f3d99792419edff848edf79449640cdbe45ebb60..06c82e65f63e7180e941e8c0b91921c45803de27 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)) {