don't expose I_NEW inodes via dentry->d_inode

d_instantiate(dentry, inode);
	unlock_new_inode(inode);

is a bad idea; do it the other way round...

Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Al Viro 2012-07-19 09:18:15 +04:00
commit 8fc37ec54c
7 changed files with 19 additions and 19 deletions

View file

@ -41,8 +41,8 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
{
int err = ext2_add_link(dentry, inode);
if (!err) {
d_instantiate(dentry, inode);
unlock_new_inode(inode);
d_instantiate(dentry, inode);
return 0;
}
inode_dec_link_count(inode);
@ -242,8 +242,8 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
if (err)
goto out_fail;
d_instantiate(dentry, inode);
unlock_new_inode(inode);
d_instantiate(dentry, inode);
out:
return err;