lkml.org 
[lkml]   [2010]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ext3: call blkdev_issue_flush on fsync
On 2010-03-26, at 10:50, Surbhi Palande wrote:
> To ensure that bits are truly on-disk after an fsync,
> we should call blkdev_issue_flush if barriers are supported.
>
> @@ -87,5 +89,7 @@ int ext3_sync_file(struct file * file, struct
> dentry *dentry, int datasync)
> ret = sync_inode(inode, &wbc);
> }
> out:
> + if (journal && (journal->j_flags & JFS_BARRIER))
> + blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
> return ret;


I don't think we need yet ANOTHER barrier here. If the filesystem is
mounted in data={journaled,ordered} mode it will have flushed the data
to disk as part of the journal commit. If there is an external
journal, there were patches posted to have it flush the data on the
filesystem device at transaction commit time.

Since fsync on any inode always implies sync of the journal, the only
time that this would be needed is if we are running in no-journal
mode, or possibly in data=writeback mode.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.



\
 
 \ /
  Last update: 2010-03-26 20:27    [W:0.041 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site