aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/inode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index bed4a0abd0d1..c7d9250fbc3f 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4394,7 +4394,8 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4394 inode->i_op = &ext4_symlink_inode_operations; 4394 inode->i_op = &ext4_symlink_inode_operations;
4395 ext4_set_aops(inode); 4395 ext4_set_aops(inode);
4396 } 4396 }
4397 } else { 4397 } else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) ||
4398 S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
4398 inode->i_op = &ext4_special_inode_operations; 4399 inode->i_op = &ext4_special_inode_operations;
4399 if (raw_inode->i_block[0]) 4400 if (raw_inode->i_block[0])
4400 init_special_inode(inode, inode->i_mode, 4401 init_special_inode(inode, inode->i_mode,
@@ -4402,6 +4403,13 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4402 else 4403 else
4403 init_special_inode(inode, inode->i_mode, 4404 init_special_inode(inode, inode->i_mode,
4404 new_decode_dev(le32_to_cpu(raw_inode->i_block[1]))); 4405 new_decode_dev(le32_to_cpu(raw_inode->i_block[1])));
4406 } else {
4407 brelse(bh);
4408 ret = -EIO;
4409 ext4_error(inode->i_sb, __func__,
4410 "bogus i_mode (%o) for inode=%lu",
4411 inode->i_mode, inode->i_ino);
4412 goto bad_inode;
4405 } 4413 }
4406 brelse(iloc.bh); 4414 brelse(iloc.bh);
4407 ext4_set_inode_flags(inode); 4415 ext4_set_inode_flags(inode);