From 67660d1ae22a61c311ab66e5973d1a80a08fa931 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 23 Jun 2016 09:26:16 -0400 Subject: [PATCH] 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 --- src/os/bluestore/BlueFS.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.39.5