diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-28 01:29:48 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-28 01:29:48 -0500 |
commit | a3b2157e72e321fa313389ac744bbf6d6cb6986d (patch) | |
tree | 83bbc1d8709dc609ba8c4a65d79cce9cc5d54856 /fs | |
parent | 7b5be621993567d39f09a5190c4d651241be296f (diff) |
9p: make sure ->lookup() adds fid to the right dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/vfs_inode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 80ff01bcae3d..d86edc8d3fd0 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -824,7 +824,6 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
824 | p9_client_clunk(fid); | 824 | p9_client_clunk(fid); |
825 | return ERR_CAST(inode); | 825 | return ERR_CAST(inode); |
826 | } | 826 | } |
827 | v9fs_fid_add(dentry, fid); | ||
828 | /* | 827 | /* |
829 | * If we had a rename on the server and a parallel lookup | 828 | * If we had a rename on the server and a parallel lookup |
830 | * for the new name, then make sure we instantiate with | 829 | * for the new name, then make sure we instantiate with |
@@ -833,7 +832,11 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
833 | * k/b. | 832 | * k/b. |
834 | */ | 833 | */ |
835 | res = d_materialise_unique(dentry, inode); | 834 | res = d_materialise_unique(dentry, inode); |
836 | if (IS_ERR(res)) | 835 | if (!res) |
836 | v9fs_fid_add(dentry, fid); | ||
837 | else if (!IS_ERR(res)) | ||
838 | v9fs_fid_add(res, fid); | ||
839 | else | ||
837 | p9_client_clunk(fid); | 840 | p9_client_clunk(fid); |
838 | return res; | 841 | return res; |
839 | } | 842 | } |