From a7e35712e894152c6b277bcb69e3623e0e6d545c Mon Sep 17 00:00:00 2001 From: Curt Wohlgemuth Date: Tue, 7 Feb 2012 11:16:06 -0800 Subject: [PATCH] fsx: fix msync parameters This explicitly sends MS_SYNC as the flag to msync() in fsx.c, in domapwrite(). Without this flag, the memory written to the mmap'ed region will not be flushed to disk; in fact, on Linux, calling msync() with a '0' or MS_ASYNC flag is a no-op. Signed-off-by: Curt Wohlgemuth Signed-off-by: Christoph Hellwig --- ltp/fsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index b36c201e..2f1e3e83 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -779,7 +779,7 @@ domapwrite(unsigned offset, unsigned size) report_failure(202); } memcpy(p + pg_offset, good_buf + offset, size); - if (msync(p, map_size, 0) != 0) { + if (msync(p, map_size, MS_SYNC) != 0) { prterr("domapwrite: msync"); report_failure(203); } -- 2.30.2