]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid calling rejoin_gather_finish() two times successively
authorYan, Zheng <zyan@redhat.com>
Tue, 8 May 2018 02:42:05 +0000 (10:42 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 23 May 2018 08:05:56 +0000 (16:05 +0800)
If MDCache::rejoin_gather is empty and MDCache::rejoins_pending is true
when MDCache::process_imported_caps() calls maybe_send_pending_rejoins()
Both MDCache::rejoin_send_rejoins() and MDCache::process_imported_caps()
may call rejoin_gather_finish().

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Fixes: http://tracker.ceph.com/issues/24047
(cherry picked from commit 0451dae777a2a9b1e70303d7bbc4398849f45f3e)

src/mds/MDCache.cc

index c10cc2fe4f8d5d786b0e9b7247c03a9a82376d92..38fc78a9d8286305f714afad9afd2c77969cabf2 100644 (file)
@@ -4128,7 +4128,7 @@ void MDCache::rejoin_send_rejoins()
   rejoins_pending = false;
 
   // nothing?
-  if (mds->is_rejoin() && rejoins.empty()) {
+  if (mds->is_rejoin() && rejoin_gather.empty()) {
     dout(10) << "nothing to rejoin" << dendl;
     rejoin_gather_finish();
   }
@@ -5363,11 +5363,10 @@ bool MDCache::process_imported_caps()
   } else {
     trim_non_auth();
 
+    assert(rejoin_gather.count(mds->get_nodeid()));
     rejoin_gather.erase(mds->get_nodeid());
+    assert(!rejoin_ack_gather.count(mds->get_nodeid()));
     maybe_send_pending_rejoins();
-
-    if (rejoin_gather.empty() && rejoin_ack_gather.count(mds->get_nodeid()))
-      rejoin_gather_finish();
   }
   return false;
 }