summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/ufs/namei.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index 1f5223c9e1e2..2346b83fa12b 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -174,7 +174,12 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir,
inode_inc_link_count(inode);
ihold(inode);
- error = ufs_add_nondir(dentry, inode);
+ error = ufs_add_link(dentry, inode);
+ if (error) {
+ inode_dec_link_count(inode);
+ iput(inode);
+ } else
+ d_instantiate(dentry, inode);
unlock_ufs(dir->i_sb);
return error;
}