xfs
[Top] [All Lists]

[PATCH] xfs: wait for direct I/O to complete in fsync and write_inode

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfs: wait for direct I/O to complete in fsync and write_inode
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sat, 17 Apr 2010 20:02:53 -0400
User-agent: Mutt/1.5.19 (2009-01-05)
We need to wait for all pending direct I/O requests before taking care of
metadata in fsync and write_inode.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfs/fs/xfs/linux-2.6/xfs_file.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_file.c        2010-03-15 09:24:53.332004798 
-0700
+++ xfs/fs/xfs/linux-2.6/xfs_file.c     2010-04-16 09:50:08.197004486 -0700
@@ -115,6 +115,8 @@ xfs_file_fsync(
 
        xfs_iflags_clear(ip, XFS_ITRUNCATED);
 
+       xfs_ioend_wait(ip);
+
        /*
         * We always need to make sure that the required inode state is safe on
         * disk.  The inode might be clean but we still might need to force the
Index: xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_super.c       2010-04-05 11:21:31.643011861 
-0700
+++ xfs/fs/xfs/linux-2.6/xfs_super.c    2010-04-16 09:51:19.891255575 -0700
@@ -1092,6 +1092,7 @@ xfs_fs_write_inode(
                 * the code will only flush the inode if it isn't already
                 * being flushed.
                 */
+               xfs_ioend_wait(ip);
                xfs_ilock(ip, XFS_ILOCK_SHARED);
                if (ip->i_update_core) {
                        error = xfs_log_inode(ip);

<Prev in Thread] Current Thread [Next in Thread>