aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-02-17 14:34:57 -0500
committerAlex Elder <aelder@sgi.com>2010-03-01 17:35:10 -0500
commit024910cbac323ab2e5ad6d7fa7958799b04b9728 (patch)
tree6902b06ec9307930e17964192f9e8bfdb750d3bd
parent77d7a0c2eeb285c9069e15396703d0cb9690ac50 (diff)
xfs: fix inode pincount check in fsync
We need to hold the ilock to check the inode pincount safely. While we're at it also remove the check for ip->i_itemp->ili_last_lsn, a pinned inode always has it set. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 43f9554adaac..42dd3bcfba6b 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -180,17 +180,12 @@ xfs_file_fsync(
180 * disk yet, the inode will be still be pinned. If it is, 180 * disk yet, the inode will be still be pinned. If it is,
181 * force the log. 181 * force the log.
182 */ 182 */
183 xfs_iunlock(ip, XFS_ILOCK_SHARED);
184 if (xfs_ipincount(ip)) { 183 if (xfs_ipincount(ip)) {
185 if (ip->i_itemp->ili_last_lsn) { 184 error = _xfs_log_force_lsn(ip->i_mount,
186 error = _xfs_log_force_lsn(ip->i_mount, 185 ip->i_itemp->ili_last_lsn,
187 ip->i_itemp->ili_last_lsn, 186 XFS_LOG_SYNC, &log_flushed);
188 XFS_LOG_SYNC, &log_flushed);
189 } else {
190 error = _xfs_log_force(ip->i_mount,
191 XFS_LOG_SYNC, &log_flushed);
192 }
193 } 187 }
188 xfs_iunlock(ip, XFS_ILOCK_SHARED);
194 } 189 }
195 190
196 if (ip->i_mount->m_flags & XFS_MOUNT_BARRIER) { 191 if (ip->i_mount->m_flags & XFS_MOUNT_BARRIER) {