From f717ce63608c9f914487ba4c5cf27ca3549fa9df Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 28 May 2012 17:02:25 -0400 Subject: [PATCH] --- yaml --- r: 309959 b: refs/heads/master c: 7e936b737211e6b54e34b71a827e56b872e958d8 h: refs/heads/master i: 309957: 1e35c465742522fe66b514ca2865b5eca32e479f 309955: 1a3fe9a08119175098d8d6c20254ba3acd88ffc2 309951: 57ddf73a6a7097cb70a56fa009c7f9cbce0df5d1 v: v3 --- [refs] | 2 +- trunk/fs/ext4/namei.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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,