aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r--fs/xfs/xfs_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 78d8b0299592..54a67dd9ac0a 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -197,8 +197,11 @@ xfs_file_fsync(
197 * to flush the log up to the latest LSN that touched the inode. 197 * to flush the log up to the latest LSN that touched the inode.
198 */ 198 */
199 xfs_ilock(ip, XFS_ILOCK_SHARED); 199 xfs_ilock(ip, XFS_ILOCK_SHARED);
200 if (xfs_ipincount(ip)) 200 if (xfs_ipincount(ip)) {
201 lsn = ip->i_itemp->ili_last_lsn; 201 if (!datasync ||
202 (ip->i_itemp->ili_fields & ~XFS_ILOG_TIMESTAMP))
203 lsn = ip->i_itemp->ili_last_lsn;
204 }
202 xfs_iunlock(ip, XFS_ILOCK_SHARED); 205 xfs_iunlock(ip, XFS_ILOCK_SHARED);
203 206
204 if (lsn) 207 if (lsn)