Skip to contentSkip to conversation

xfs_io: fix missing syncfs command

PATCH In review Amir Goldstein 2 participants 3 messages Jan 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_io: fix missing syncfs command

Fixes commit c7dd81c7cd ("xfs_io: add sync and syncfs commands")

---
 configure.ac          | 1 +
 include/builddefs.in  | 1 +
 m4/package_libcdev.m4 | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)
configure.ac +1 -0
index 3a4655f..1506b5e 100644
@@ -135,6 +135,7 @@ AC_HAVE_FIEMAP
 AC_HAVE_PREADV
 AC_HAVE_COPY_FILE_RANGE
 AC_HAVE_SYNC_FILE_RANGE
+AC_HAVE_SYNCFS
 AC_HAVE_MNTENT
 AC_HAVE_FLS
 AC_HAVE_READDIR
include/builddefs.in +1 -0
index 612b547..ec1fe61 100644
@@ -105,6 +105,7 @@ HAVE_FIEMAP = @have_fiemap@
 HAVE_PREADV = @have_preadv@
 HAVE_COPY_FILE_RANGE = @have_copy_file_range@
 HAVE_SYNC_FILE_RANGE = @have_sync_file_range@
+HAVE_SYNCFS = @have_syncfs@
 HAVE_READDIR = @have_readdir@
 HAVE_MNTENT = @have_mntent@
 HAVE_FLS = @have_fls@
m4/package_libcdev.m4 +1 -1
index 7d5a42d..bc3b4ce 100644
@@ -189,7 +189,7 @@ AC_DEFUN([AC_HAVE_SYNCFS],
 #include <unistd.h>
     ], [
          syncfs(0);
-    ], have_sync_fs=yes
+    ], have_syncfs=yes
        AC_MSG_RESULT(yes),
        AC_MSG_RESULT(no))
     AC_SUBST(have_syncfs)
Signature · 1 line
2.7.4
#2 lore raw
Quoted 2 lines · Christoph Hellwig

Oops.. Time to add tests that use syncfs :)

Was just about to when I saw this surprise..

problem is. I only figured out an easy way to test using xfs stats:
https://github.com/amir73il/overlayfs/blob/master/tests/xfs_syncfs.sh

and I am wondering what would be a more generic way to test it. This test case fails to flush xfs log on syncfs from overlayfs over xfs, which is why I wrote it.