Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234276
b: refs/heads/master
c: aae8a97
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Al Viro committed Mar 15, 2011
1 parent 40ccf4c commit ee38bf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: becfd1f37544798cbdfd788f32c827160fab98c1
refs/heads/master: aae8a97d3ec30788790d1720b71d76fd8eb44b73
6 changes: 5 additions & 1 deletion trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2906,7 +2906,11 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
return error;

mutex_lock(&inode->i_mutex);
error = dir->i_op->link(old_dentry, dir, new_dentry);
/* Make sure we don't allow creating hardlink to an unlinked file */
if (inode->i_nlink == 0)
error = -ENOENT;
else
error = dir->i_op->link(old_dentry, dir, new_dentry);
mutex_unlock(&inode->i_mutex);
if (!error)
fsnotify_link(dir, inode, new_dentry);
Expand Down

0 comments on commit ee38bf5

Please sign in to comment.