From: Sam Lang Date: Thu, 13 Dec 2012 00:28:12 +0000 (-1000) Subject: filestore: Don't keep checking for syncfs if found X-Git-Tag: v0.57~323 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4605fddcf66258ec65a0d937143812b98246ff46;p=ceph.git filestore: Don't keep checking for syncfs if found Valgrind outputs a warning for unrecognized system calls, and does so for the syscall(__SYS_syncfs,...) and syscall(__NR_syncfs, ...) calls. This patch avoids making those calls (and the warning, when run in valgrind) if the syncfs libc call is available. INFO:teuthology.task.ceph.osd.1.err:--10568-- WARNING: unhandled syscall: 306 INFO:teuthology.task.ceph.osd.1.err:--10568-- You may be able to write your own handler. INFO:teuthology.task.ceph.osd.1.err:--10568-- Read the file README_MISSING_SYSCALL_OR_IOCTL. INFO:teuthology.task.ceph.osd.1.err:--10568-- Nevertheless we consider this a bug. Please report INFO:teuthology.task.ceph.osd.1.err:--10568-- it at http://valgrind.org/support/bug_reports.html. Signed-off-by: Sam Lang --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 8cb8720738e87..99cea7f22daf1 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -1227,16 +1227,14 @@ int FileStore::_detect_fs() } else { dout(0) << "mount syncfs(2) syscall supported by glibc BUT NOT the kernel" << dendl; } -#endif -#ifdef SYS_syncfs +#elif defined(SYS_syncfs) if (syscall(SYS_syncfs, fd) == 0) { dout(0) << "mount syscall(SYS_syncfs, fd) fully supported" << dendl; have_syncfs = true; } else { dout(0) << "mount syscall(SYS_syncfs, fd) supported by libc BUT NOT the kernel" << dendl; } -#endif -#ifdef __NR_syncfs +#elif defined(__NR_syncfs) if (syscall(__NR_syncfs, fd) == 0) { dout(0) << "mount syscall(__NR_syncfs, fd) fully supported" << dendl; have_syncfs = true;