From: tangwenjun Date: Wed, 24 Jan 2018 07:23:42 +0000 (+0800) Subject: os/bluestore.cc: no need to fsync when failed to write label X-Git-Tag: v13.0.2~423^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ebb5cc7c61daed0c78b6dc87681a3e4dc56ab5f;p=ceph.git os/bluestore.cc: no need to fsync when failed to write label Signed-off-by: tangwenjun --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index a2599f400898..5ec86ea91a88 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4160,12 +4160,14 @@ int BlueStore::_write_bdev_label(CephContext *cct, if (r < 0) { derr << __func__ << " failed to write to " << path << ": " << cpp_strerror(r) << dendl; + goto out; } r = ::fsync(fd); if (r < 0) { derr << __func__ << " failed to fsync " << path << ": " << cpp_strerror(r) << dendl; } +out: VOID_TEMP_FAILURE_RETRY(::close(fd)); return r; }