Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47600
b: refs/heads/master
c: 2988a77
h: refs/heads/master
v: v3
  • Loading branch information
Eric Sandeen authored and Linus Torvalds committed Feb 11, 2007
1 parent 6f28ae7 commit 05808d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 967bb77c69e3bc44dd1128a8b503a205cce3fd4a
refs/heads/master: 2988a7740dc0dd9a0cb56576e8fe1d777dff0db3
6 changes: 6 additions & 0 deletions trunk/fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,12 @@ static int ext3_link (struct dentry * old_dentry,

if (inode->i_nlink >= EXT3_LINK_MAX)
return -EMLINK;
/*
* Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing
* otherwise has the potential to corrupt the orphan inode list.
*/
if (inode->i_nlink == 0)
return -ENOENT;

retry:
handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) +
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,12 @@ static int ext4_link (struct dentry * old_dentry,

if (inode->i_nlink >= EXT4_LINK_MAX)
return -EMLINK;
/*
* Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing
* otherwise has the potential to corrupt the orphan inode list.
*/
if (inode->i_nlink == 0)
return -ENOENT;

retry:
handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
Expand Down

0 comments on commit 05808d2

Please sign in to comment.