]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: Don't keep checking for syncfs if found
authorSam Lang <sam.lang@inktank.com>
Thu, 13 Dec 2012 00:28:12 +0000 (14:28 -1000)
committerSam Lang <sam.lang@inktank.com>
Thu, 13 Dec 2012 01:17:48 +0000 (15:17 -1000)
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 <sam.lang@inktank.com>
src/os/FileStore.cc

index 8cb8720738e879f132290a5e2bb6fdb869939a85..99cea7f22daf1958eb54ff25270def9c5e8c8863 100644 (file)
@@ -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;