From: Jianpeng Ma Date: Wed, 7 Jan 2015 07:26:08 +0000 (+0800) Subject: common: Directly return the result of syncfs(). X-Git-Tag: v0.92~25^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f7faa4d8d3af3d2e3889c23290b016f27d36386;p=ceph.git common: Directly return the result of syncfs(). 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 --- diff --git a/src/common/sync_filesystem.h b/src/common/sync_filesystem.h index 8882cbb18980..49283b3e0aef 100644 --- a/src/common/sync_filesystem.h +++ b/src/common/sync_filesystem.h @@ -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