]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore.cc: no need to fsync when failed to write label 20092/head
authortangwenjun <tang.wenjun3@zte.com.cn>
Wed, 24 Jan 2018 07:23:42 +0000 (15:23 +0800)
committertangwenjun <tang.wenjun3@zte.com.cn>
Thu, 25 Jan 2018 01:16:59 +0000 (09:16 +0800)
Signed-off-by: tangwenjun <tang.wenjun3@zte.com.cn>
src/os/bluestore/BlueStore.cc

index a2599f400898d791e60d7a4e82729ecc47748a98..5ec86ea91a88bc3a36325bf980008c535c56e169 100644 (file)
@@ -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;
 }