All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix inode pincount check in fsync
@ 2010-02-17 19:34 Christoph Hellwig, Christoph Hellwig
  2010-02-17 22:53 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig, Christoph Hellwig @ 2010-02-17 19:34 UTC (permalink / raw)
  To: xfs

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>

Index: xfs/fs/xfs/linux-2.6/xfs_file.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_file.c	2010-02-17 10:46:24.440003402 +0100
+++ xfs/fs/xfs/linux-2.6/xfs_file.c	2010-02-17 10:47:25.499028406 +0100
@@ -180,17 +180,12 @@ xfs_file_fsync(
 		 * disk yet, the inode will be still be pinned.  If it is,
 		 * force the log.
 		 */
-		xfs_iunlock(ip, XFS_ILOCK_SHARED);
 		if (xfs_ipincount(ip)) {
-			if (ip->i_itemp->ili_last_lsn) {
-				error = _xfs_log_force_lsn(ip->i_mount,
-						ip->i_itemp->ili_last_lsn,
-						XFS_LOG_SYNC, &log_flushed);
-			} else {
-				error = _xfs_log_force(ip->i_mount,
-						XFS_LOG_SYNC, &log_flushed);
-			}
+			error = _xfs_log_force_lsn(ip->i_mount,
+					ip->i_itemp->ili_last_lsn,
+					XFS_LOG_SYNC, &log_flushed);
 		}
+		xfs_iunlock(ip, XFS_ILOCK_SHARED);
 	}
 
 	if (ip->i_mount->m_flags & XFS_MOUNT_BARRIER) {

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: fix inode pincount check in fsync
  2010-02-17 19:34 [PATCH] xfs: fix inode pincount check in fsync Christoph Hellwig, Christoph Hellwig
@ 2010-02-17 22:53 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2010-02-17 22:53 UTC (permalink / raw)
  To: Christoph Hellwig, Christoph Hellwig; +Cc: xfs

On Wed, Feb 17, 2010 at 02:34:57PM -0500, Christoph Hellwig wrote:
> 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>

Looks good.

Reviewed-by: Dave Chinner <david@fromorbit.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-17 22:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-17 19:34 [PATCH] xfs: fix inode pincount check in fsync Christoph Hellwig, Christoph Hellwig
2010-02-17 22:53 ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.