Skip to content

Commit

Permalink
NFS: Fix NFSv3 exclusive open semantics
Browse files Browse the repository at this point in the history
Commit c0204fd (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>
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Jan 13, 2011
1 parent 581548d commit 8a0eebf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,14 +1579,18 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
{
struct iattr attr;
int error;
int open_flags = 0;

dfprintk(VFS, "NFS: create(%s/%ld), %s\n",
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);

attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE;

error = NFS_PROTO(dir)->create(dir, dentry, &attr, 0, NULL);
if ((nd->flags & LOOKUP_CREATE) != 0)
open_flags = nd->intent.open.flags;

error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, NULL);
if (error != 0)
goto out_err;
return 0;
Expand Down

0 comments on commit 8a0eebf

Please sign in to comment.