diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-19 01:18:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-22 16:00:58 -0400 |
commit | 8fc37ec54cd8e37193b0d42809b785ff19661c34 (patch) | |
tree | 12040128b054dc1b163433358b0fd2b8ec843762 /fs/ext2 | |
parent | 32a7991b6a9c758e4e2b8166c5e1cc7563c3dcde (diff) |
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 <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 9ba7de0e5903..73b0d9519836 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c | |||
@@ -41,8 +41,8 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode) | |||
41 | { | 41 | { |
42 | int err = ext2_add_link(dentry, inode); | 42 | int err = ext2_add_link(dentry, inode); |
43 | if (!err) { | 43 | if (!err) { |
44 | d_instantiate(dentry, inode); | ||
45 | unlock_new_inode(inode); | 44 | unlock_new_inode(inode); |
45 | d_instantiate(dentry, inode); | ||
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | inode_dec_link_count(inode); | 48 | inode_dec_link_count(inode); |
@@ -242,8 +242,8 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) | |||
242 | if (err) | 242 | if (err) |
243 | goto out_fail; | 243 | goto out_fail; |
244 | 244 | ||
245 | d_instantiate(dentry, inode); | ||
246 | unlock_new_inode(inode); | 245 | unlock_new_inode(inode); |
246 | d_instantiate(dentry, inode); | ||
247 | out: | 247 | out: |
248 | return err; | 248 | return err; |
249 | 249 | ||