]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/cephfs/Resetter.cc
update sources to 12.2.7
[ceph.git] / ceph / src / tools / cephfs / Resetter.cc
index 58465c2ffc79ed3458afe2d90a5cf1f58ddee8cf..7741db44352b3a1e7a56f98085940b939d2a679f 100644 (file)
@@ -170,12 +170,25 @@ int Resetter::_write_reset_event(Journaler *journaler)
 
   bufferlist bl;
   le->encode_with_header(bl, CEPH_FEATURES_SUPPORTED_DEFAULT);
-  
+
   cout << "writing EResetJournal entry" << std::endl;
-  C_SaferCond cond;
   journaler->append_entry(bl);
-  journaler->flush(&cond);
 
-  return cond.wait();
+  int ret;
+  {
+    C_SaferCond cond;
+    journaler->flush(&cond);
+    ret = cond.wait();
+    if (ret < 0)
+      return ret;
+  }
+  {
+    // wait until all journal prezero ops are done
+    C_SaferCond cond;
+    journaler->wait_for_prezero(&cond);
+    cond.wait();
+  }
+
+  return ret;
 }