From: Sage Weil Date: Thu, 23 Jun 2016 13:26:16 +0000 (-0400) Subject: os/bluestore/BlueFS: do not dirty log file when size changes X-Git-Tag: v11.0.1~891^2~14 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=67660d1ae22a61c311ab66e5973d1a80a08fa931;p=ceph.git os/bluestore/BlueFS: do not dirty log file when size changes We only need to dirty the log file if the allocate changes. Replay is smart enough to learn the file size as it goes. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index cf096869f767d..0e0eb0c54c2f6 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -1110,7 +1110,12 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length) } if (h->file->fnode.size < offset + length) { h->file->fnode.size = offset + length; - must_dirty = true; + if (h->file->fnode.ino != 1) { + // we do not need to dirty the log file when the file size + // changes because replay is smart enough to discover it on its + // own. + must_dirty = true; + } } if (must_dirty) { h->file->fnode.mtime = ceph_clock_now(NULL);