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 <curtw@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Curt Wohlgemuth
2012-02-07 11:16:06 -08:00
committed by Christoph Hellwig
parent 749f28fdc5
commit a7e35712e8
+1 -1
View File
@@ -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);
}