]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueFS: do not dirty log file when size changes
authorSage Weil <sage@redhat.com>
Thu, 23 Jun 2016 13:26:16 +0000 (09:26 -0400)
committerSage Weil <sage@redhat.com>
Thu, 30 Jun 2016 16:56:56 +0000 (12:56 -0400)
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 <sage@redhat.com>
src/os/bluestore/BlueFS.cc

index cf096869f767de9cd9a9eeff98125f85612cfb6c..0e0eb0c54c2f663004bff9928459849eecdbaf52 100644 (file)
@@ -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);