Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263634
b: refs/heads/master
c: 73f5071
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Sep 6, 2011
1 parent 279bd0b commit 9257c5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 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: f88657ce3f9713a0c62101dffb0e972a979e77b9
refs/heads/master: 73f507171cfa407b19f254aef95cbb058c8180cf
28 changes: 21 additions & 7 deletions trunk/fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nameidata)
{
struct dentry *res;
struct super_block *sb;
struct v9fs_session_info *v9ses;
struct p9_fid *dfid, *fid;
Expand Down Expand Up @@ -856,22 +857,35 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,

return ERR_PTR(result);
}

inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb);
/*
* Make sure we don't use a wrong inode due to parallel
* unlink. For cached mode create calls request for new
* inode. But with cache disabled, lookup should do this.
*/
if (v9ses->cache)
inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb);
else
inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
if (IS_ERR(inode)) {
result = PTR_ERR(inode);
inode = NULL;
goto error;
}

result = v9fs_fid_add(dentry, fid);
if (result < 0)
goto error_iput;

inst_out:
d_add(dentry, inode);
return NULL;

/*
* If we had a rename on the server and a parallel lookup
* for the new name, then make sure we instantiate with
* the new name. ie look up for a/b, while on server somebody
* moved b under k and client parallely did a lookup for
* k/b.
*/
res = d_materialise_unique(dentry, inode);
if (!IS_ERR(res))
return res;
result = PTR_ERR(res);
error_iput:
iput(inode);
error:
Expand Down

0 comments on commit 9257c5f

Please sign in to comment.