All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix syncfs handling in error case
@ 2012-11-27 15:23 Danny Al-Gaaf
  2012-11-27 15:42 ` Danny Al-Gaaf
  0 siblings, 1 reply; 4+ messages in thread
From: Danny Al-Gaaf @ 2012-11-27 15:23 UTC (permalink / raw)
  To: ceph-devel; +Cc: Sage Weil

If the call to syncfs() fails, don't try to call syncfs again via
syscall(). If HAVE_SYS_SYNCFS is defined, don't use syscall() with
SYS_syncfs.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
---
 src/common/sync_filesystem.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/common/sync_filesystem.h b/src/common/sync_filesystem.h
index dc90b89..976400f 100644
--- a/src/common/sync_filesystem.h
+++ b/src/common/sync_filesystem.h
@@ -34,9 +34,7 @@ inline int sync_filesystem(int fd)
 #ifdef HAVE_SYS_SYNCFS
   if (syncfs(fd) == 0)
     return 0;
-#endif
-
-#ifdef SYS_syncfs
+#elif defined(SYS_syncfs)
   if (syscall(SYS_syncfs, fd) == 0)
     return 0;
 #endif
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] fix syncfs handling in error case
@ 2012-11-27 15:54 Danny Al-Gaaf
  2012-11-27 16:53 ` Sage Weil
  0 siblings, 1 reply; 4+ messages in thread
From: Danny Al-Gaaf @ 2012-11-27 15:54 UTC (permalink / raw)
  To: ceph-devel; +Cc: Sage Weil

If the call to syncfs() fails, don't try to call syncfs again via
syscall(). If HAVE_SYS_SYNCFS is defined, don't fall through to try
syscall() with SYS_syncfs or __NR_syncfs.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
---
 src/common/sync_filesystem.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/common/sync_filesystem.h b/src/common/sync_filesystem.h
index 5b23576..eff18d2 100644
--- a/src/common/sync_filesystem.h
+++ b/src/common/sync_filesystem.h
@@ -34,14 +34,10 @@ inline int sync_filesystem(int fd)
 #ifdef HAVE_SYS_SYNCFS
   if (syncfs(fd) == 0)
     return 0;
-#endif
-
-#ifdef SYS_syncfs
+#elif defined(SYS_syncfs)
   if (syscall(SYS_syncfs, fd) == 0)
     return 0;
-#endif
-
-#ifdef __NR_syncfs
+#elif defined(__NR_syncfs)
   if (syscall(__NR_syncfs, fd) == 0)
     return 0;
 #endif
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-27 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 15:23 [PATCH] fix syncfs handling in error case Danny Al-Gaaf
2012-11-27 15:42 ` Danny Al-Gaaf
  -- strict thread matches above, loose matches on Subject: below --
2012-11-27 15:54 Danny Al-Gaaf
2012-11-27 16:53 ` Sage Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.