linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Curt Wohlgemuth <curtw@google.com>
To: xfs@oss.sgi.com
Cc: linux-ext4@vger.kernel.org, Curt Wohlgemuth <curtw@google.com>
Subject: [PATCH] xfstests: fix msync() call in fsx.c:domapwrite()
Date: Tue,  7 Feb 2012 11:16:06 -0800	[thread overview]
Message-ID: <1328642166-389-1-git-send-email-curtw@google.com> (raw)

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


             reply	other threads:[~2012-02-07 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 19:16 Curt Wohlgemuth [this message]
2012-02-12 23:48 ` [PATCH] xfstests: fix msync() call in fsx.c:domapwrite() Christoph Hellwig
2012-03-31 20:12 ` [PATCH] fsx: fix msync parameters Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328642166-389-1-git-send-email-curtw@google.com \
    --to=curtw@google.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).