public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* question about xfs_fsync on linux
@ 2008-07-14 22:13 Chris Torek
  2008-07-14 23:03 ` Dave Chinner
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Torek @ 2008-07-14 22:13 UTC (permalink / raw)
  To: xfs

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

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

end of thread, other threads:[~2008-07-17  0:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-14 22:13 question about xfs_fsync on linux Chris Torek
2008-07-14 23:03 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox