]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueFS: flush log if needed
authorSage Weil <sage@redhat.com>
Thu, 10 Dec 2015 22:19:29 +0000 (17:19 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:06:57 +0000 (13:06 -0500)
If a file has dirty metadata (but no dirty data), we
still need to flush the log when it is flushed.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc

index d6e0736e6d5fa2dd3bd5f88bf0e4218b25a5f838..78de3a567915bde9703eef8d8cdcc54921bb9d0b 100644 (file)
@@ -961,24 +961,17 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
   return 0;
 }
 
-/*
-void BlueFS::_aio_finish(void *priv)
-{
-  FileWriter *h = static_cast<FileWriter*>(priv);
-  Mutex::Locker l(h->lock);
-  dout(10) << __func__ << " h " << h << " on " << h->file->fnode << dendl;
-  if (--h->num_aio_in_flight == 0) {
-    h->cond.Signal();
-  }
-}
-*/
-
 int BlueFS::_flush(FileWriter *h)
 {
   uint64_t length = h->buffer.length();
   uint64_t offset = h->pos;
   if (length == 0) {
-    dout(10) << __func__ << " " << h << " no dirty data on "
+    if (h->file->dirty) {
+      dout(10) << __func__ << " " << h << " no data, flushing metadata on "
+              << h->file->fnode << dendl;
+      return _flush_log();
+    }
+    dout(10) << __func__ << " " << h << " no dirty data or metadata on "
             << h->file->fnode << dendl;
     return 0;
   }