summaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-07-25 18:06:32 +0000
committerEric Van Hensbergen <ericvh@gmail.com>2011-09-06 08:17:14 -0500
commit5441ae5eb3614d3c28f77073370738a2820c88e4 (patch)
treeeb61016b762edb343051e5724527eb1484555085 /fs/9p/vfs_inode.c
parentddf28352b80c86754a6424e3a61e8bdf9213b3c7 (diff)
downloadlinux-5441ae5eb3614d3c28f77073370738a2820c88e4.tar.gz
linux-5441ae5eb3614d3c28f77073370738a2820c88e4.tar.bz2
linux-5441ae5eb3614d3c28f77073370738a2820c88e4.zip
fs/9p: Add fid before dentry instantiation
d_instantiate marks the dentry positive. So a parallel lookup and mkdir of the directory can find dentry that doesn't have fid attached. This can result in both the code path doing v9fs_fid_add which results in v9fs_dentry leak. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r--fs/9p/vfs_inode.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 8bb5507e822f..43dd540663af 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -645,13 +645,11 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err);
goto error;
}
- d_instantiate(dentry, inode);
err = v9fs_fid_add(dentry, fid);
if (err < 0)
goto error;
-
+ d_instantiate(dentry, inode);
return ofid;
-
error:
if (ofid)
p9_client_clunk(ofid);