All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: fix msync() call in fsx.c:domapwrite()
@ 2012-02-07 19:16 ` Curt Wohlgemuth
  0 siblings, 0 replies; 6+ messages in thread
From: Curt Wohlgemuth @ 2012-02-07 19:16 UTC (permalink / raw)
  To: xfs; +Cc: linux-ext4, Curt Wohlgemuth

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>
---
 ltp/fsx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index b36c201..2f1e3e8 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);
 	}
-- 
1.7.7.3


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

* [PATCH] xfstests: fix msync() call in fsx.c:domapwrite()
@ 2012-02-07 19:16 ` Curt Wohlgemuth
  0 siblings, 0 replies; 6+ messages in thread
From: Curt Wohlgemuth @ 2012-02-07 19:16 UTC (permalink / raw)
  To: xfs; +Cc: linux-ext4, Curt Wohlgemuth

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>
---
 ltp/fsx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index b36c201..2f1e3e8 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);
 	}
-- 
1.7.7.3

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: fix msync() call in fsx.c:domapwrite()
  2012-02-07 19:16 ` Curt Wohlgemuth
@ 2012-02-12 23:48   ` Christoph Hellwig
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2012-02-12 23:48 UTC (permalink / raw)
  To: Curt Wohlgemuth; +Cc: xfs, linux-ext4

On Tue, Feb 07, 2012 at 11:16:06AM -0800, Curt Wohlgemuth wrote:
> 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.

Looks sensible to me - what exactly msync did has always been grossly
different for different operating systems, including changing meaning
on Linux a few times, so let's be explicit.

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] xfstests: fix msync() call in fsx.c:domapwrite()
@ 2012-02-12 23:48   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2012-02-12 23:48 UTC (permalink / raw)
  To: Curt Wohlgemuth; +Cc: linux-ext4, xfs

On Tue, Feb 07, 2012 at 11:16:06AM -0800, Curt Wohlgemuth wrote:
> 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.

Looks sensible to me - what exactly msync did has always been grossly
different for different operating systems, including changing meaning
on Linux a few times, so let's be explicit.

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] fsx: fix msync parameters
  2012-02-07 19:16 ` Curt Wohlgemuth
@ 2012-03-31 20:12   ` Christoph Hellwig
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2012-03-31 20:12 UTC (permalink / raw)
  To: Curt Wohlgemuth; +Cc: xfs, linux-ext4

Applied.

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

* Re: [PATCH] fsx: fix msync parameters
@ 2012-03-31 20:12   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2012-03-31 20:12 UTC (permalink / raw)
  To: Curt Wohlgemuth; +Cc: linux-ext4, xfs

Applied.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2012-03-31 20:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 19:16 [PATCH] xfstests: fix msync() call in fsx.c:domapwrite() Curt Wohlgemuth
2012-02-07 19:16 ` Curt Wohlgemuth
2012-02-12 23:48 ` Christoph Hellwig
2012-02-12 23:48   ` Christoph Hellwig
2012-03-31 20:12 ` [PATCH] fsx: fix msync parameters Christoph Hellwig
2012-03-31 20:12   ` Christoph Hellwig

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.