diff --git a/[refs] b/[refs] index d59539b7d04c..8398ba9eee14 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 967ac8af4475ce45474800709b12137aa7634c77 +refs/heads/master: 7e936b737211e6b54e34b71a827e56b872e958d8 diff --git a/trunk/fs/ext4/namei.c b/trunk/fs/ext4/namei.c index a9fd5f48f3bf..daf8260f0b03 100644 --- a/trunk/fs/ext4/namei.c +++ b/trunk/fs/ext4/namei.c @@ -1330,6 +1330,12 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru EXT4_ERROR_INODE(dir, "bad inode number: %u", ino); return ERR_PTR(-EIO); } + if (unlikely(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,