aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-13 14:15:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 15:06:29 -0500
commit8a0eebf66e3b1deae036553ba641a9c2bdbae678 (patch)
tree642d4367dd30a55f78244891479cc08f2983eb7e /fs/nfs/dir.c
parent581548db3b3c0f6e25b500329eb02e3c72e7acbe (diff)
NFS: Fix NFSv3 exclusive open semantics
Commit c0204fd2b8fe047b18b67e07e1bf2a03691240cd (NFS: Clean up nfs4_proc_create()) broke NFSv3 exclusive open by removing the code that passes the O_EXCL flag down to nfs3_proc_create(). This patch reverts that offending hunk from the original commit. Reported-by: Nick Bowler <nbowler@elliptictech.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org [2.6.37] Tested-by: Nick Bowler <nbowler@elliptictech.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 95b081bc9e25..64ee240f3c80 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1579,6 +1579,7 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
1579{ 1579{
1580 struct iattr attr; 1580 struct iattr attr;
1581 int error; 1581 int error;
1582 int open_flags = 0;
1582 1583
1583 dfprintk(VFS, "NFS: create(%s/%ld), %s\n", 1584 dfprintk(VFS, "NFS: create(%s/%ld), %s\n",
1584 dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); 1585 dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
@@ -1586,7 +1587,10 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
1586 attr.ia_mode = mode; 1587 attr.ia_mode = mode;
1587 attr.ia_valid = ATTR_MODE; 1588 attr.ia_valid = ATTR_MODE;
1588 1589
1589 error = NFS_PROTO(dir)->create(dir, dentry, &attr, 0, NULL); 1590 if ((nd->flags & LOOKUP_CREATE) != 0)
1591 open_flags = nd->intent.open.flags;
1592
1593 error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, NULL);
1590 if (error != 0) 1594 if (error != 0)
1591 goto out_err; 1595 goto out_err;
1592 return 0; 1596 return 0;