public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Torek <chris.torek@windriver.com>
To: xfs@oss.sgi.com
Subject: question about xfs_fsync on linux
Date: Mon, 14 Jul 2008 16:13:40 -0600	[thread overview]
Message-ID: <200807142213.m6EMDeE23640@elf.torek.net> (raw)

The implementation of xfs_fsync() in 2.6.2x, for reasonably late x,
reads as follows in xfs_vnodeops.c:

	error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping);

We have a customer who is seeing data not "make it" to disk on a
stress test that involves doing an fsync() or fdatasync() and then
deliberately rebooting the machine (to simulate a failure; note
that the underlying RAID has its own battery backup and this is
just one of many different parts of the stress-test).

Looking into this, I am now wondering if this call should read:

	error = filemap_write_and_wait(vn_to_inode(XFS_ITOV(ip))->i_mapping);

instead.  From a quick skim, it seems as though fdatawait does not
start dirty page pushes, but rather only wait for any that are
currently in progress.  The write-and-wait call starts them first,
which seems more appropriate for an fsync.  I must admit to being
relatively unfamiliar with all the innards of the Linux filemap
code though.

Chris

             reply	other threads:[~2008-07-14 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 22:13 Chris Torek [this message]
2008-07-14 23:03 ` question about xfs_fsync on linux Dave Chinner
2008-07-15  1:29   ` Chris Torek
2008-07-15  2:48     ` Dave Chinner
2008-07-16 21:58       ` Chris Torek
2008-07-17  0:22         ` Dave Chinner

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=200807142213.m6EMDeE23640@elf.torek.net \
    --to=chris.torek@windriver.com \
    --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