Messages in this thread | | | Date | Wed, 14 Jan 2009 11:59:52 -0500 | From | Theodore Tso <> | Subject | Re: ext2 + -osync: not as easy as it seems |
| |
On Wed, Jan 14, 2009 at 03:37:56PM +0100, Jan Kara wrote: > > Um, we have that already; the sync_inode() followed by > > blkdev_issue_flush() is the path taken by fdatasync(), I do believe. > > Maybe ext4-patch-queue changes that area but in Linus's tree I see: > > if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) > goto out; > > So if we just overwrite some data, we send them to disk via fdatawrite() > and then we quickly bail out from ext4_sync_file() without doing > blkdev_issue_flush().
So you're thinking about fdatawrite() being called by some code path other than ext4_sync_file() before we call fsync()? Yeah, that could happen.... I think that will only happen if the file is opened O_SYNC, but that raises another issue, which is that we're not forcing a flush for writes when the file is opened O_SYNC.
- Ted
| |