[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>
This commit is contained in:
committed by
Lachlan McIlroy
parent
c1e554aeea
commit
978b723712
@ -229,14 +229,6 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
|
||||
#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */
|
||||
#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */
|
||||
|
||||
/*
|
||||
* Flags to vop_fsync/reclaim.
|
||||
*/
|
||||
#define FSYNC_NOWAIT 0 /* asynchronous flush */
|
||||
#define FSYNC_WAIT 0x1 /* synchronous fsync or forced reclaim */
|
||||
#define FSYNC_INVAL 0x2 /* flush and invalidate cached data */
|
||||
#define FSYNC_DATA 0x4 /* synchronous fsync of data only */
|
||||
|
||||
/*
|
||||
* Tracking vnode activity.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user