]> git.baikalelectronics.ru Git - kernel.git/commit
[XFS] Fix fsync() b0rkage.
authorDavid Chinner <dgc@sgi.com>
Mon, 19 May 2008 06:29:46 +0000 (16:29 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Fri, 23 May 2008 05:25:25 +0000 (15:25 +1000)
commit00aa72a5732de3e3cd0d60863fd52db64e27f0fd
treeed4c8af42502efeb7ae79b166bb5890347b3de93
parent70c14cc75f84cf8fff13211d2b3dbf95ef3dff4a
[XFS] Fix fsync() b0rkage.

xfs_fsync() fails to wait for data I/O completion before checking if the
inode is dirty or clean to decide whether to log the inode or not. This
misses inode size updates when the data flushed by the fsync() is
extending the file.

Hence, like fdatasync(), we need to wait for I/o completion first, then
check the inode for cleanliness. Doing so makes the behaviour of
xfs_fsync() identical for fsync and fdatasync and we *always* use
synchronous semantics if the inode is dirty. Therefore also kill the
differences and remove the unused flags from the xfs_fsync function and
callers.

SGI-PV: 981296
SGI-Modid: xfs-linux-melb:xfs-kern:31033a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_vnode.h
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.h