Skip to content

Commit

Permalink
NFS: writes should not clobber utimes() calls
Browse files Browse the repository at this point in the history
Ensure that we flush out writes in the case when someone calls utimes() in
order to set the file times.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 20, 2006
1 parent 7bab377 commit 755c1e2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,11 +859,9 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)

lock_kernel();
nfs_begin_data_update(inode);
/* Write all dirty data if we're changing file permissions or size */
if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE)) != 0) {
filemap_write_and_wait(inode->i_mapping);
nfs_wb_all(inode);
}
/* Write all dirty data */
filemap_write_and_wait(inode->i_mapping);
nfs_wb_all(inode);
/*
* Return any delegations if we're going to change ACLs
*/
Expand Down

0 comments on commit 755c1e2

Please sign in to comment.