VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Bob Copeland <me@bobcopeland.com> 2008-08-15 00:40:46 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2008-08-15 08:35:44 -0700 commit: c963343a1150106819773e828c9b237ed977615b parent: be4de35263f59ca1f4740edfffbfb02cc3f2189e
Commit Summary:
omfs: fix potential oops when directory size is corrupted
Diffstat:
1 file changed, 1 insertion, 2 deletions
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index a95fe5984f4b..d29047b1b9b0 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -232,8 +232,7 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino)
 		inode->i_mode = S_IFDIR | (S_IRWXUGO & ~sbi->s_dmask);
 		inode->i_op = &omfs_dir_inops;
 		inode->i_fop = &omfs_dir_operations;
-		inode->i_size = be32_to_cpu(oi->i_head.h_body_size) +
-			sizeof(struct omfs_header);
+		inode->i_size = sbi->s_sys_blocksize;
 		inc_nlink(inode);
 		break;
 	case OMFS_FILE: