summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-06-05 15:10:20 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 16:33:10 +0400
commit50de348c3604f7684a89ce64180666d4dd74623f (patch)
tree4dfbd39f22bf3e1ed6aef272250d289aeb8a541d
parent8867fe5899010a0c0ac36dadfdacf1072b1c990c (diff)
downloadlinux-3.10-50de348c3604f7684a89ce64180666d4dd74623f.tar.gz
linux-3.10-50de348c3604f7684a89ce64180666d4dd74623f.tar.bz2
linux-3.10-50de348c3604f7684a89ce64180666d4dd74623f.zip
nfs: don't use nd->intent.open.flags
Instead check LOOKUP_EXCL in nd->flags, which is basically what the open intent flags were used for. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/nfs/dir.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 45015d32a86..0432f474771 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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;
@@ -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 */
@@ -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)