Skip to contentSkip to conversation

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

PATCH In review Christoph Hellwig 2 participants 3 messages Mar 6, 2010 – Apr 13, 2010 XFS filesystem

lore
Share & tools
lore
#0 lore raw

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

We need to wait for all pending direct I/O requests before taking care of metadata in fsync and write_inode.

Note that the write_inode hunk will causes conflicts when merging with mainline, I'm not sure how to best deal with that.

fs/xfs/linux-2.6/xfs_file.c +2 -0
Index: xfs/fs/xfs/linux-2.6/xfs_file.c
===================================================================
@@ -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
fs/xfs/linux-2.6/xfs_super.c +2 -0
Index: xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
@@ -1079,6 +1079,8 @@ xfs_fs_write_inode(
 		if (error)
 			goto out;
 
+		xfs_ioend_wait(ip);
+
 		/*
 		 * Make sure the inode has hit stable storage.  By using the
 		 * log and the fsync transactions we reduce the IOs we have

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

We need to wait for all pending direct I/O requests before taking care of metadata in fsync and write_inode.

Sorry, I missed this one when scaning the list for outstanding patches yesterday. The concept looks fine, though:

Quoted 2 lines

Note that the write_inode hunk will causes conflicts when merging with mainline, I'm not sure how to best deal with that.

I don't think it applies to the current xfs-dev tree any more, either. Can you rebase it?

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs