diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 7ffbb98ddec3..089da5b5d20a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2036,7 +2036,8 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
2036 | struct rpc_cred *cred; | 2036 | struct rpc_cred *cred; |
2037 | struct nfs4_state *state; | 2037 | struct nfs4_state *state; |
2038 | struct dentry *res; | 2038 | struct dentry *res; |
2039 | fmode_t fmode = nd->intent.open.flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC); | 2039 | int open_flags = nd->intent.open.flags; |
2040 | fmode_t fmode = open_flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC); | ||
2040 | 2041 | ||
2041 | if (nd->flags & LOOKUP_CREATE) { | 2042 | if (nd->flags & LOOKUP_CREATE) { |
2042 | attr.ia_mode = nd->intent.open.create_mode; | 2043 | attr.ia_mode = nd->intent.open.create_mode; |
@@ -2044,8 +2045,9 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
2044 | if (!IS_POSIXACL(dir)) | 2045 | if (!IS_POSIXACL(dir)) |
2045 | attr.ia_mode &= ~current_umask(); | 2046 | attr.ia_mode &= ~current_umask(); |
2046 | } else { | 2047 | } else { |
2048 | open_flags &= ~O_EXCL; | ||
2047 | attr.ia_valid = 0; | 2049 | attr.ia_valid = 0; |
2048 | BUG_ON(nd->intent.open.flags & O_CREAT); | 2050 | BUG_ON(open_flags & O_CREAT); |
2049 | } | 2051 | } |
2050 | 2052 | ||
2051 | cred = rpc_lookup_cred(); | 2053 | cred = rpc_lookup_cred(); |
@@ -2054,7 +2056,7 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
2054 | parent = dentry->d_parent; | 2056 | parent = dentry->d_parent; |
2055 | /* Protect against concurrent sillydeletes */ | 2057 | /* Protect against concurrent sillydeletes */ |
2056 | nfs_block_sillyrename(parent); | 2058 | nfs_block_sillyrename(parent); |
2057 | state = nfs4_do_open(dir, &path, fmode, nd->intent.open.flags, &attr, cred); | 2059 | state = nfs4_do_open(dir, &path, fmode, open_flags, &attr, cred); |
2058 | put_rpccred(cred); | 2060 | put_rpccred(cred); |
2059 | if (IS_ERR(state)) { | 2061 | if (IS_ERR(state)) { |
2060 | if (PTR_ERR(state) == -ENOENT) { | 2062 | if (PTR_ERR(state) == -ENOENT) { |
@@ -2273,8 +2275,7 @@ static int nfs4_get_referral(struct inode *dir, const struct qstr *name, struct | |||
2273 | out: | 2275 | out: |
2274 | if (page) | 2276 | if (page) |
2275 | __free_page(page); | 2277 | __free_page(page); |
2276 | if (locations) | 2278 | kfree(locations); |
2277 | kfree(locations); | ||
2278 | return status; | 2279 | return status; |
2279 | } | 2280 | } |
2280 | 2281 | ||