From: Sage Weil Date: Mon, 16 Oct 2017 22:46:03 +0000 (-0500) Subject: os/bluestore: fsync on _write_bdev_label X-Git-Tag: v13.0.1~508^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18256%2Fhead;p=ceph.git os/bluestore: fsync on _write_bdev_label Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index b43be134d76..d2f72714037 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; }