From: Sage Weil Date: Thu, 10 Dec 2015 22:19:29 +0000 (-0500) Subject: os/bluestore/BlueFS: flush log if needed X-Git-Tag: v10.0.3~154^2~144 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9565f0d834d078969e9742da4df66c3c6dee3e4a;p=ceph.git os/bluestore/BlueFS: flush log if needed 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 --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index d6e0736e6d5f..78de3a567915 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -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(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; }