aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorNadav Shemer <nadav@tonian.com>2013-07-21 10:21:43 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-07-23 18:18:53 -0400
commitcc7936f9ad085351bc2ccb403c403392e1337050 (patch)
tree16e40809fd24a00b64f55bd545b9d209c814b95c /fs/nfs
parentd7067b2db78aab1a76f9c443b1fcf81c3e35dd50 (diff)
nfs: fix open(O_RDONLY|O_TRUNC) in NFS4.0
nfs4_proc_setattr removes ATTR_OPEN from sattr->ia_valid, but later nfs4_do_setattr checks for it Signed-off-by: Nadav Shemer <nadav@tonian.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index cf11799297c4..1bf291f03c61 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2940,10 +2940,10 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
2940 2940
2941 /* Deal with open(O_TRUNC) */ 2941 /* Deal with open(O_TRUNC) */
2942 if (sattr->ia_valid & ATTR_OPEN) 2942 if (sattr->ia_valid & ATTR_OPEN)
2943 sattr->ia_valid &= ~(ATTR_MTIME|ATTR_CTIME|ATTR_OPEN); 2943 sattr->ia_valid &= ~(ATTR_MTIME|ATTR_CTIME);
2944 2944
2945 /* Optimization: if the end result is no change, don't RPC */ 2945 /* Optimization: if the end result is no change, don't RPC */
2946 if ((sattr->ia_valid & ~(ATTR_FILE)) == 0) 2946 if ((sattr->ia_valid & ~(ATTR_FILE|ATTR_OPEN)) == 0)
2947 return 0; 2947 return 0;
2948 2948
2949 /* Search for an existing open(O_WRITE) file */ 2949 /* Search for an existing open(O_WRITE) file */