提交 2e5afe54 编写于 作者: A Al Viro

ext2: make sure that partially set up inodes won't be returned by ext2_iget()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 5c1a68a3
......@@ -611,8 +611,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
dquot_drop(inode);
inode->i_flags |= S_NOQUOTA;
clear_nlink(inode);
unlock_new_inode(inode);
iput(inode);
discard_new_inode(inode);
return ERR_PTR(err);
fail:
......
......@@ -45,8 +45,7 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
return 0;
}
inode_dec_link_count(inode);
unlock_new_inode(inode);
iput(inode);
discard_new_inode(inode);
return err;
}
......@@ -192,8 +191,7 @@ static int ext2_symlink (struct inode * dir, struct dentry * dentry,
out_fail:
inode_dec_link_count(inode);
unlock_new_inode(inode);
iput (inode);
discard_new_inode(inode);
goto out;
}
......@@ -261,8 +259,7 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
out_fail:
inode_dec_link_count(inode);
inode_dec_link_count(inode);
unlock_new_inode(inode);
iput(inode);
discard_new_inode(inode);
out_dir:
inode_dec_link_count(dir);
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册