Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217065
b: refs/heads/master
c: 898f635
h: refs/heads/master
i:
  217063: 0d6e611
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 23, 2010
1 parent 858a749 commit b8e259b
Show file tree
Hide file tree
Showing 2 changed files with 24 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: 6eaa61496fb3b93cceface7a296415fc4c030bce
refs/heads/master: 898f635c4297e91ceac675d83c4a460f26118342
35 changes: 23 additions & 12 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
struct dentry *res = NULL;
struct inode *inode;
int open_flags;
int err;

dfprintk(VFS, "NFS: atomic_lookup(%s/%ld), %s\n",
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
Expand Down Expand Up @@ -1119,9 +1120,8 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
if (!IS_POSIXACL(dir))
attr.ia_mode &= ~current_umask();
} else {
open_flags &= ~O_EXCL;
open_flags &= ~(O_EXCL | O_CREAT);
attr.ia_valid = 0;
BUG_ON(open_flags & O_CREAT);
}

/* Open the file on the server */
Expand Down Expand Up @@ -1150,13 +1150,18 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
}
}
res = d_add_unique(dentry, inode);
nfs_unblock_sillyrename(dentry->d_parent);
if (res != NULL) {
dput(ctx->path.dentry);
ctx->path.dentry = dget(res);
dentry = res;
}
nfs_intent_set_file(nd, ctx);
nfs_unblock_sillyrename(dentry->d_parent);
err = nfs_intent_set_file(nd, ctx);
if (err < 0) {
if (res != NULL)
dput(res);
return ERR_PTR(err);
}
out:
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
return res;
Expand Down Expand Up @@ -1221,11 +1226,13 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
}
}
iput(inode);
if (inode == dentry->d_inode) {
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
nfs_intent_set_file(nd, ctx);
} else
if (inode != dentry->d_inode)
goto out_drop;

nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
ret = nfs_intent_set_file(nd, ctx);
if (ret >= 0)
ret = 1;
out:
dput(parent);
return ret;
Expand Down Expand Up @@ -1262,20 +1269,24 @@ static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode,
ctx = nameidata_to_nfs_open_context(dentry, nd);
error = PTR_ERR(ctx);
if (IS_ERR(ctx))
goto out_err;
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)
nfs_intent_set_file(nd, ctx);
if (ctx != NULL) {
error = nfs_intent_set_file(nd, ctx);
if (error < 0)
goto out_err;
}
return 0;
out_put_ctx:
if (ctx != NULL)
put_nfs_open_context(ctx);
out_err:
out_err_drop:
d_drop(dentry);
out_err:
return error;
}

Expand Down

0 comments on commit b8e259b

Please sign in to comment.