Commit 76962b5e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman

xfs: remove invalid barrier optimization from xfs_fsync

commit e8b217e7 upstream

Date: Tue, 2 Feb 2010 10:16:26 +1100
We always need to flush the disk write cache and can't skip it just because
the no inode attributes have changed.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <david@fromorbit.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 83b546b8
...@@ -597,7 +597,7 @@ xfs_fsync( ...@@ -597,7 +597,7 @@ xfs_fsync(
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
int error = 0; int error = 0;
int log_flushed = 0, changed = 1; int log_flushed = 0;
xfs_itrace_entry(ip); xfs_itrace_entry(ip);
...@@ -627,19 +627,11 @@ xfs_fsync( ...@@ -627,19 +627,11 @@ xfs_fsync(
* disk yet, the inode will be still be pinned. If it is, * disk yet, the inode will be still be pinned. If it is,
* force the log. * force the log.
*/ */
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
if (xfs_ipincount(ip)) { if (xfs_ipincount(ip)) {
error = _xfs_log_force(ip->i_mount, (xfs_lsn_t)0, error = _xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
XFS_LOG_FORCE | XFS_LOG_SYNC, XFS_LOG_FORCE | XFS_LOG_SYNC,
&log_flushed); &log_flushed);
} else {
/*
* If the inode is not pinned and nothing has changed
* we don't need to flush the cache.
*/
changed = 0;
} }
} else { } else {
/* /*
...@@ -674,7 +666,7 @@ xfs_fsync( ...@@ -674,7 +666,7 @@ xfs_fsync(
xfs_iunlock(ip, XFS_ILOCK_EXCL); xfs_iunlock(ip, XFS_ILOCK_EXCL);
} }
if ((ip->i_mount->m_flags & XFS_MOUNT_BARRIER) && changed) { if (ip->i_mount->m_flags & XFS_MOUNT_BARRIER) {
/* /*
* If the log write didn't issue an ordered tag we need * If the log write didn't issue an ordered tag we need
* to flush the disk cache for the data device now. * to flush the disk cache for the data device now.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment