diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 1f5223c9e1e2c94ac22f94de629da756fbce8e8c..2346b83fa12baee5a6bc5f2fe572d382c051a74a 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; }