From: Andrew Morton Cc: Ryusuke Konishi Signed-off-by: Andrew Morton --- fs/nilfs2/namei.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff -puN fs/nilfs2/namei.c~nilfs2-continuous-snapshotting-file-system-fix-fix-2 fs/nilfs2/namei.c --- a/fs/nilfs2/namei.c~nilfs2-continuous-snapshotting-file-system-fix-fix-2 +++ a/fs/nilfs2/namei.c @@ -80,7 +80,6 @@ nilfs_lookup(struct inode *dir, struct d struct dentry *nilfs_get_parent(struct dentry *child) { unsigned long ino; - struct dentry *parent; struct inode *inode; struct dentry dotdot; @@ -94,12 +93,7 @@ struct dentry *nilfs_get_parent(struct d inode = nilfs_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) return ERR_CAST(inode); - parent = d_alloc_anon(inode); - if (!parent) { - iput(inode); - parent = ERR_PTR(-ENOMEM); - } - return parent; + return d_obtain_alias(inode); } /* _