diff options
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 3d36d5a..5767c50 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1031,17 +1031,25 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru inode = NULL; if (bh) { __u32 ino = le32_to_cpu(de->inode); - brelse(bh); if (!ext4_valid_inum(dir->i_sb, ino)) { + /* for debugging, sangwoo2.lee */ + printk(KERN_ERR "Name of directory entry has bad inode# : %s\n", de->name); + print_bh(dir->i_sb, bh, 0, EXT4_BLOCK_SIZE(dir->i_sb)); + /* for debugging */ + brelse(bh); + EXT4_ERROR_INODE(dir, "bad inode number: %u", ino); return ERR_PTR(-EIO); } + brelse(bh); + inode = ext4_iget(dir->i_sb, ino); if (IS_ERR(inode)) { if (PTR_ERR(inode) == -ESTALE) { + /* In case of -ESTALE, printing debugging data is already done in ext4_iget */ EXT4_ERROR_INODE(dir, - "deleted inode referenced: %u", - ino); + "deleted inode referenced: %u at parent inode : %lu", + ino, dir->i_ino); return ERR_PTR(-EIO); } else { return ERR_CAST(inode); |