Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257333
b: refs/heads/master
c: f7c8586
h: refs/heads/master
i:
  257331: 9525946
v: v3
  • Loading branch information
Al Viro committed Jul 20, 2011
1 parent 4d6d049 commit 79de658
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: 511415980ace0ceecd71088dbe1c7ce4ca7c79fe
refs/heads/master: f7c85868fcacc331dd3454a4f08f006d7942521f
24 changes: 12 additions & 12 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,35 +1567,35 @@ static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode,
struct nfs_open_context *ctx = NULL;
struct iattr attr;
int error;
int open_flags = 0;
int open_flags = O_CREAT|O_EXCL|FMODE_READ;

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;

if ((nd->flags & LOOKUP_CREATE) != 0) {
if (nd && (nd->flags & LOOKUP_OPEN) != 0)
open_flags = nd->intent.open.flags;

ctx = create_nfs_open_context(dentry, open_flags);
error = PTR_ERR(ctx);
if (IS_ERR(ctx))
goto out_err_drop;
}
ctx = create_nfs_open_context(dentry, open_flags);
error = PTR_ERR(ctx);
if (IS_ERR(ctx))
goto out_err_drop;

error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, ctx);
if (error != 0)
goto out_put_ctx;
if (ctx != NULL) {
if (nd && (nd->flags & LOOKUP_OPEN) != 0) {
error = nfs_intent_set_file(nd, ctx);
if (error < 0)
goto out_err;
} else {
put_nfs_open_context(ctx);
}
return 0;
out_put_ctx:
if (ctx != NULL)
put_nfs_open_context(ctx);
put_nfs_open_context(ctx);
out_err_drop:
d_drop(dentry);
out_err:
Expand Down Expand Up @@ -1657,15 +1657,15 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
{
struct iattr attr;
int error;
int open_flags = 0;
int open_flags = O_CREAT|O_EXCL|FMODE_READ;

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;

if ((nd->flags & LOOKUP_CREATE) != 0)
if (nd && (nd->flags & LOOKUP_OPEN) != 0)
open_flags = nd->intent.open.flags;

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

0 comments on commit 79de658

Please sign in to comment.