lkml.org 
[lkml]   [2008]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] omfs: fix potential oops when directory size is corrupted
On Thu, 14 Aug 2008 23:13:41 -0400 Bob Copeland <me@bobcopeland.com> wrote:

> --- 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:

We don't need to use i_size_write() on this code path, but we do in other
places. There's also i_size_read(). I wonder if omfs gets it right
everywhere..


\
 
 \ /
  Last update: 2008-08-15 09:23    [W:0.048 / U:1.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site