diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-06-05 09:10:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:33:10 -0400 |
commit | 50de348c3604f7684a89ce64180666d4dd74623f (patch) | |
tree | 4dfbd39f22bf3e1ed6aef272250d289aeb8a541d /fs | |
parent | 8867fe5899010a0c0ac36dadfdacf1072b1c990c (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/dir.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 45015d32a865..0432f474771b 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) | |||
1538 | struct dentry *parent = NULL; | 1538 | struct dentry *parent = NULL; |
1539 | struct inode *inode; | 1539 | struct inode *inode; |
1540 | struct inode *dir; | 1540 | struct inode *dir; |
1541 | int openflags, ret = 0; | 1541 | int ret = 0; |
1542 | 1542 | ||
1543 | if (nd->flags & LOOKUP_RCU) | 1543 | if (nd->flags & LOOKUP_RCU) |
1544 | return -ECHILD; | 1544 | return -ECHILD; |
@@ -1562,9 +1562,8 @@ static int nfs4_lookup_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1562 | /* NFS only supports OPEN on regular files */ | 1562 | /* NFS only supports OPEN on regular files */ |
1563 | if (!S_ISREG(inode->i_mode)) | 1563 | if (!S_ISREG(inode->i_mode)) |
1564 | goto no_open_dput; | 1564 | goto no_open_dput; |
1565 | openflags = nd->intent.open.flags; | ||
1566 | /* We cannot do exclusive creation on a positive dentry */ | 1565 | /* We cannot do exclusive creation on a positive dentry */ |
1567 | if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) | 1566 | if (nd && nd->flags & LOOKUP_EXCL) |
1568 | goto no_open_dput; | 1567 | goto no_open_dput; |
1569 | 1568 | ||
1570 | /* Let f_op->open() actually open (and revalidate) the file */ | 1569 | /* Let f_op->open() actually open (and revalidate) the file */ |
@@ -1643,8 +1642,8 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, | |||
1643 | attr.ia_mode = mode; | 1642 | attr.ia_mode = mode; |
1644 | attr.ia_valid = ATTR_MODE; | 1643 | attr.ia_valid = ATTR_MODE; |
1645 | 1644 | ||
1646 | if (nd) | 1645 | if (nd && !(nd->flags & LOOKUP_EXCL)) |
1647 | open_flags = nd->intent.open.flags; | 1646 | open_flags = O_CREAT; |
1648 | 1647 | ||
1649 | error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); | 1648 | error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); |
1650 | if (error != 0) | 1649 | if (error != 0) |