Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312891
b: refs/heads/master
c: 50de348
h: refs/heads/master
i:
  312889: e575ecc
  312887: 9aed925
v: v3
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jul 14, 2012
1 parent fafcb29 commit 3e7fc08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8867fe5899010a0c0ac36dadfdacf1072b1c990c
refs/heads/master: 50de348c3604f7684a89ce64180666d4dd74623f
9 changes: 4 additions & 5 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ static int nfs4_lookup_revalidate(struct dentry *dentry, struct nameidata *nd)
struct dentry *parent = NULL;
struct inode *inode;
struct inode *dir;
int openflags, ret = 0;
int ret = 0;

if (nd->flags & LOOKUP_RCU)
return -ECHILD;
Expand All @@ -1562,9 +1562,8 @@ static int nfs4_lookup_revalidate(struct dentry *dentry, struct nameidata *nd)
/* NFS only supports OPEN on regular files */
if (!S_ISREG(inode->i_mode))
goto no_open_dput;
openflags = nd->intent.open.flags;
/* We cannot do exclusive creation on a positive dentry */
if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
if (nd && nd->flags & LOOKUP_EXCL)
goto no_open_dput;

/* Let f_op->open() actually open (and revalidate) the file */
Expand Down Expand Up @@ -1643,8 +1642,8 @@ static int nfs_create(struct inode *dir, struct dentry *dentry,
attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE;

if (nd)
open_flags = nd->intent.open.flags;
if (nd && !(nd->flags & LOOKUP_EXCL))
open_flags = O_CREAT;

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

0 comments on commit 3e7fc08

Please sign in to comment.