[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: fsync in ext3: A question



Hi,

On Fri, 2004-02-13 at 21:47, Vijayan Prabhakaran wrote:

> I have a question on fsync() and ext3's journaling modes.
> 
> Assume that I call fsync(fd) on a file.
> 
> If that file is in 'data=journal' mode, would the fsync() return once the
> data gets safely into the journal ?

Should do, yes.  We don't record buffers as being on the inode dirty
list after a write() in data=journal mode, so fsync's dirty-buffer-flush
is a NOOP there.  We _do_ record the buffers as being on the transaction
list, so the transaction commit that fsync() does flushes to the journal
but not to backing store.  The eventual writeback still happens because
of the normal journal checkpointing rules: we don't allow a journal wrap
until the final writeback has happened.

> On the other hand, if that file is in 'data=writeback' mode, would the
> fsync() return only when the data gets safely into its actual location ?

Yes.

--Stephen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]