| Submitter | Andreas Dilger |
|---|---|
| Date | May 28, 2012, 8:29 p.m. |
| Message ID | <4790434C-0DF2-4186-BE4C-CE97633F107C@dilger.ca> |
| Download | mbox | patch |
| Permalink | /patch/161641/ |
| State | Superseded |
| Headers | show |
Comments
Patch
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 349d7b3..4a9c99d 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1037,6 +1037,12 @@ static struct dentry *ext4_lookup(struct inode EXT4_ERROR_INODE(dir, "bad inode number: %u", ino); return ERR_PTR(-EIO); } + if (ino == dir->i_ino) { + EXT4_ERROR_INODE(dir, "'%.*s' linked to parent dir", + dentry->d_name.len, + dentry->d_name.name); + return ERR_PTR(-EIO); + } inode = ext4_iget(dir->i_sb, ino); if (inode == ERR_PTR(-ESTALE)) { EXT4_ERROR_INODE(dir,