Commit 37bc5743 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

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.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <david@fromorbit.com>
parent fce1cad6
...@@ -115,6 +115,8 @@ xfs_file_fsync( ...@@ -115,6 +115,8 @@ xfs_file_fsync(
xfs_iflags_clear(ip, XFS_ITRUNCATED); xfs_iflags_clear(ip, XFS_ITRUNCATED);
xfs_ioend_wait(ip);
/* /*
* We always need to make sure that the required inode state is safe on * 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 * disk. The inode might be clean but we still might need to force the
......
...@@ -1093,6 +1093,7 @@ xfs_fs_write_inode( ...@@ -1093,6 +1093,7 @@ xfs_fs_write_inode(
* the code will only flush the inode if it isn't already * the code will only flush the inode if it isn't already
* being flushed. * being flushed.
*/ */
xfs_ioend_wait(ip);
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
if (ip->i_update_core) { if (ip->i_update_core) {
error = xfs_log_inode(ip); error = xfs_log_inode(ip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment