summaryrefslogtreecommitdiffstats
path: root/fs/nfs/proc.c
diff options
context:
space:
mode:
authorTrond Myklebust2015-02-26 22:09:04 +0100
committerTrond Myklebust2015-03-02 05:23:05 +0100
commitf044636d972246d451e06226cc1675d5da389762 (patch)
tree7fbfe0ffc4f5a5b3f9ccf56de8fe887c7394027c /fs/nfs/proc.c
parentNFS: Add a helper to set attribute barriers (diff)
downloadkernel-qcow2-linux-f044636d972246d451e06226cc1675d5da389762.tar.gz
kernel-qcow2-linux-f044636d972246d451e06226cc1675d5da389762.tar.xz
kernel-qcow2-linux-f044636d972246d451e06226cc1675d5da389762.zip
NFS: Add attribute update barriers to nfs_setattr_update_inode()
Ensure that other operations which raced with our setattr RPC call cannot revert the file attribute changes that were made on the server. To do so, we artificially bump the attribute generation counter on the inode so that all calls to nfs_fattr_init() that precede ours will be dropped. The motivation for the patch came from Chuck Lever's reports of readaheads racing with truncate operations and causing the file size to be reverted. Reported-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Tested-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r--fs/nfs/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index b09cc23d6f43..6202bc0f11bb 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -139,7 +139,7 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
nfs_fattr_init(fattr);
status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
if (status == 0)
- nfs_setattr_update_inode(inode, sattr);
+ nfs_setattr_update_inode(inode, sattr, fattr);
dprintk("NFS reply setattr: %d\n", status);
return status;
}