]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fsync on _write_bdev_label 18256/head
authorSage Weil <sage@redhat.com>
Mon, 16 Oct 2017 22:46:03 +0000 (17:46 -0500)
committerSage Weil <sage@redhat.com>
Mon, 16 Oct 2017 22:46:03 +0000 (17:46 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index b43be134d76c1475c27ea974200a52ebbcc11dc5..d2f7271403738a6b79985770c4d172c22c95909a 100644 (file)
@@ -4054,6 +4054,11 @@ int BlueStore::_write_bdev_label(CephContext *cct,
     derr << __func__ << " failed to write to " << path
         << ": " << cpp_strerror(r) << dendl;
   }
+  r = ::fsync(fd);
+  if (r < 0) {
+    derr << __func__ << " failed to fsync " << path
+        << ": " << cpp_strerror(r) << dendl;
+  }
   VOID_TEMP_FAILURE_RETRY(::close(fd));
   return r;
 }