aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/9p/vfs_inode.c7
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}