]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: resolve SIGSEGV in waiting for uncommitted fragments 37355/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 30 Jul 2020 02:36:28 +0000 (19:36 -0700)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Sep 2020 12:05:27 +0000 (14:05 +0200)
The MDSGatherBuilder was not correctly used / wired up.

Fixes: https://tracker.ceph.com/issues/46765
Fixes: 77eb368d2d35f2418875227fff9a34b5ef15a290
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit f9e58687612d60a416dd32c321069060244ce07e)

src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDSRank.cc

index 88eece19f00bb485c42581b7cc838641626986bd..03202195fd7a4db1173ad76d10751b436c2b7379 100644 (file)
@@ -12303,10 +12303,13 @@ void MDCache::rollback_uncommitted_fragment(dirfrag_t basedirfrag, frag_vec_t&&
   }
 }
 
-void MDCache::wait_for_uncommitted_fragments(MDSGather *gather)
+void MDCache::wait_for_uncommitted_fragments(MDSContext* finisher)
 {
-  for (auto& p : uncommitted_fragments)
-    p.second.waiters.push_back(gather->new_sub());
+  MDSGatherBuilder gather(g_ceph_context, finisher);
+  for (auto& p : uncommitted_fragments) {
+    p.second.waiters.push_back(gather.new_sub());
+  }
+  gather.activate();
 }
 
 void MDCache::rollback_uncommitted_fragments()
index 38fac4235db4dac098f3288933b43928d7be46cb..0602832e3d6a6dfc19acfe16113b5b71967e9786 100644 (file)
@@ -887,7 +887,7 @@ class MDCache {
   bool is_any_uncommitted_fragment() const {
     return !uncommitted_fragments.empty();
   }
-  void wait_for_uncommitted_fragments(MDSGather *gather);
+  void wait_for_uncommitted_fragments(MDSContext* finisher);
   void rollback_uncommitted_fragments();
 
   void split_dir(CDir *dir, int byn);
index e7ebee467e7acf7534b22dd696619c5d1b4c521a..e4a77e86430db739a763e3e82bed98ca0ad5e7ae 100644 (file)
@@ -1925,9 +1925,7 @@ void MDSRank::rejoin_done()
 
   if (mdcache->is_any_uncommitted_fragment()) {
     dout(1) << " waiting for uncommitted fragments" << dendl;
-    MDSGatherBuilder gather(g_ceph_context, new C_MDS_VoidFn(this, &MDSRank::rejoin_done));
-    mdcache->wait_for_uncommitted_fragments(gather.get());
-    gather.activate();
+    mdcache->wait_for_uncommitted_fragments(new C_MDS_VoidFn(this, &MDSRank::rejoin_done));
     return;
   }