diff options
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 558543c146b3..d8ef02eb178a 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -137,6 +137,7 @@ xfs_file_fsync( | |||
137 | struct xfs_trans *tp; | 137 | struct xfs_trans *tp; |
138 | int error = 0; | 138 | int error = 0; |
139 | int log_flushed = 0; | 139 | int log_flushed = 0; |
140 | xfs_lsn_t lsn = 0; | ||
140 | 141 | ||
141 | trace_xfs_file_fsync(ip); | 142 | trace_xfs_file_fsync(ip); |
142 | 143 | ||
@@ -214,9 +215,9 @@ xfs_file_fsync( | |||
214 | */ | 215 | */ |
215 | xfs_trans_ijoin(tp, ip); | 216 | xfs_trans_ijoin(tp, ip); |
216 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 217 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
217 | xfs_trans_set_sync(tp); | 218 | error = xfs_trans_commit(tp, 0); |
218 | error = _xfs_trans_commit(tp, 0, &log_flushed); | ||
219 | 219 | ||
220 | lsn = ip->i_itemp->ili_last_lsn; | ||
220 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 221 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
221 | } else { | 222 | } else { |
222 | /* | 223 | /* |
@@ -227,14 +228,14 @@ xfs_file_fsync( | |||
227 | * disk yet, the inode will be still be pinned. If it is, | 228 | * disk yet, the inode will be still be pinned. If it is, |
228 | * force the log. | 229 | * force the log. |
229 | */ | 230 | */ |
230 | if (xfs_ipincount(ip)) { | 231 | if (xfs_ipincount(ip)) |
231 | error = _xfs_log_force_lsn(mp, | 232 | lsn = ip->i_itemp->ili_last_lsn; |
232 | ip->i_itemp->ili_last_lsn, | ||
233 | XFS_LOG_SYNC, &log_flushed); | ||
234 | } | ||
235 | xfs_iunlock(ip, XFS_ILOCK_SHARED); | 233 | xfs_iunlock(ip, XFS_ILOCK_SHARED); |
236 | } | 234 | } |
237 | 235 | ||
236 | if (!error && lsn) | ||
237 | error = _xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, &log_flushed); | ||
238 | |||
238 | /* | 239 | /* |
239 | * If we only have a single device, and the log force about was | 240 | * If we only have a single device, and the log force about was |
240 | * a no-op we might have to flush the data device cache here. | 241 | * a no-op we might have to flush the data device cache here. |