]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: make flush() block forever if blackholed
authorSage Weil <sage@newdream.net>
Sun, 12 Feb 2012 05:24:54 +0000 (21:24 -0800)
committerSage Weil <sage@newdream.net>
Sun, 12 Feb 2012 05:24:54 +0000 (21:24 -0800)
If we are blackholing the disk, we need to make flush() wait forever, or
else the flush() logic will return (the IO wasn't queued!) and higher
layers will continue and (eventually) misbehave.

Signed-off-by: Sage Weil <sage@newdream.net>
src/os/FileStore.cc
src/os/FileStore.h

index aa66517926d5d2b840dc7f0cc0650caac29913e9..df77cc33b3481a81de02f4ef75e67d8bae34e335 100644 (file)
@@ -3257,6 +3257,16 @@ void FileStore::_flush_op_queue()
 void FileStore::flush()
 {
   dout(10) << "flush" << dendl;
+
+  if (g_conf->filestore_blackhole) {
+    // wait forever
+    Mutex lock("FileStore::flush::lock");
+    Cond cond;
+    lock.Lock();
+    while (true)
+      cond.Wait(lock);
+    assert(0);
+  }
  
   if (m_filestore_journal_writeahead) {
     if (journal)
index e6fb17f4ec1a4b427df37e1bad9cf616cb4e55fe..c4f5bd25e913355d377942d944827b4766d16175 100644 (file)
@@ -155,6 +155,9 @@ class FileStore : public JournalingObjectStore,
     void flush() {
       Mutex::Locker l(qlock);
 
+      while (g_conf->filestore_blackhole)
+       cond.Wait(qlock);  // wait forever
+
       // get max for journal _or_ op queues
       uint64_t seq = 0;
       if (!q.empty())