]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Directly return the result of syncfs().
authorJianpeng Ma <jianpeng.ma@intel.com>
Wed, 7 Jan 2015 07:26:08 +0000 (15:26 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Wed, 7 Jan 2015 07:26:08 +0000 (15:26 +0800)
In commit 808c644248e4, it will try sync() if syncfs() return error.
No evidence prove this way can work. And sync() don't return result
so make this function always return zero which cause filestore omit the
error.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/common/sync_filesystem.h

index 8882cbb1898083a79701fcad28baa0afd7673f86..49283b3e0aefa131df87bcdb1841e91d7ee5556c 100644 (file)
@@ -34,12 +34,18 @@ inline int sync_filesystem(int fd)
 #ifdef HAVE_SYS_SYNCFS
   if (syncfs(fd) == 0)
     return 0;
+  else
+    return -errno;
 #elif defined(SYS_syncfs)
   if (syscall(SYS_syncfs, fd) == 0)
     return 0;
+  else
+    return -errno;
 #elif defined(__NR_syncfs)
   if (syscall(__NR_syncfs, fd) == 0)
     return 0;
+  else
+    return -errno;
 #endif
 
 #ifdef BTRFS_IOC_SYNC