diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index ece82d264d5a..5587dc5c9e6b 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2315,11 +2315,11 @@ static int ext4_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) inode->i_op = &ext4_file_inode_operations; inode->i_fop = &ext4_file_operations; ext4_set_aops(inode); + d_tmpfile(dentry, inode); err = ext4_orphan_add(handle, inode); if (err) goto err_drop_inode; mark_inode_dirty(inode); - d_tmpfile(dentry, inode); unlock_new_inode(inode); } if (handle)