summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-11-25 13:29:52 -0800
committerSage Weil <sage@inktank.com>2012-11-25 13:29:52 -0800
commitbc32fc42d2bb38c300f65d577ab105f02cc50571 (patch)
tree5d58a39171a5cb627f32c2843137f90825186a41
parent6890675b87bf4b218e05b8821d602c3c1b457f13 (diff)
downloadceph-bc32fc42d2bb38c300f65d577ab105f02cc50571.tar.gz
syncfs: check for __NR_syncfs too
Also make the filestore startup tell us *all* variants that are supported, not just the first one. Tested-by: Stefan Priebe <s.priebe@profihost.ag> Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/common/sync_filesystem.h5
-rw-r--r--src/os/FileStore.cc12
2 files changed, 14 insertions, 3 deletions
diff --git a/src/common/sync_filesystem.h b/src/common/sync_filesystem.h
index dc90b890c93..5b23576ff4c 100644
--- a/src/common/sync_filesystem.h
+++ b/src/common/sync_filesystem.h
@@ -41,6 +41,11 @@ inline int sync_filesystem(int fd)
return 0;
#endif
+#ifdef __NR_syncfs
+ if (syscall(__NR_syncfs, fd) == 0)
+ return 0;
+#endif
+
#ifdef BTRFS_IOC_SYNC
if (::ioctl(fd, BTRFS_IOC_SYNC) == 0)
return 0;
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 1d6797c2b32..70eef5ae13f 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -1227,7 +1227,7 @@ int FileStore::_detect_fs()
} else {
dout(0) << "mount syncfs(2) syscall supported by glibc BUT NOT the kernel" << dendl;
}
-#else
+#endif
#ifdef SYS_syncfs
if (syscall(SYS_syncfs, fd) == 0) {
dout(0) << "mount syscall(SYS_syncfs, fd) fully supported" << dendl;
@@ -1235,11 +1235,17 @@ int FileStore::_detect_fs()
} else {
dout(0) << "mount syscall(SYS_syncfs, fd) supported by libc BUT NOT the kernel" << dendl;
}
-#else
- dout(0) << "mount syncfs(2) syscall not support by glibc" << dendl;
#endif
+#ifdef __NR_syncfs
+ if (syscall(__NR_syncfs, fd) == 0) {
+ dout(0) << "mount syscall(__NR_syncfs, fd) fully supported" << dendl;
+ have_syncfs = true;
+ } else {
+ dout(0) << "mount syscall(__NR_syncfs, fd) supported by libc BUT NOT the kernel" << dendl;
+ }
#endif
if (!have_syncfs) {
+ dout(0) << "mount syncfs(2) syscall not supported" << dendl;
if (btrfs) {
dout(0) << "mount no syncfs(2), but the btrfs SYNC ioctl will suffice" << dendl;
} else if (m_filestore_fsync_flushes_journal_data) {