aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_vnodeops.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index fd108b738559..43241e289800 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -597,7 +597,7 @@ xfs_fsync(
597{ 597{
598 xfs_trans_t *tp; 598 xfs_trans_t *tp;
599 int error = 0; 599 int error = 0;
600 int log_flushed = 0, changed = 1; 600 int log_flushed = 0;
601 601
602 xfs_itrace_entry(ip); 602 xfs_itrace_entry(ip);
603 603
@@ -627,18 +627,10 @@ xfs_fsync(
627 * disk yet, the inode will be still be pinned. If it is, 627 * disk yet, the inode will be still be pinned. If it is,
628 * force the log. 628 * force the log.
629 */ 629 */
630
631 xfs_iunlock(ip, XFS_ILOCK_SHARED); 630 xfs_iunlock(ip, XFS_ILOCK_SHARED);
632
633 if (xfs_ipincount(ip)) { 631 if (xfs_ipincount(ip)) {
634 error = _xfs_log_force(ip->i_mount, XFS_LOG_SYNC, 632 error = _xfs_log_force(ip->i_mount, XFS_LOG_SYNC,
635 &log_flushed); 633 &log_flushed);
636 } else {
637 /*
638 * If the inode is not pinned and nothing has changed
639 * we don't need to flush the cache.
640 */
641 changed = 0;
642 } 634 }
643 } else { 635 } else {
644 /* 636 /*
@@ -673,7 +665,7 @@ xfs_fsync(
673 xfs_iunlock(ip, XFS_ILOCK_EXCL); 665 xfs_iunlock(ip, XFS_ILOCK_EXCL);
674 } 666 }
675 667
676 if ((ip->i_mount->m_flags & XFS_MOUNT_BARRIER) && changed) { 668 if (ip->i_mount->m_flags & XFS_MOUNT_BARRIER) {
677 /* 669 /*
678 * If the log write didn't issue an ordered tag we need 670 * If the log write didn't issue an ordered tag we need
679 * to flush the disk cache for the data device now. 671 * to flush the disk cache for the data device now.