From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Cox Subject: Re: [PATCH 2/7] omfs: add inode routines Date: Sun, 13 Apr 2008 10:17:43 +0100 Message-ID: <20080413101743.7d762e58@core> References: <1208041121-26787-3-git-send-email-me@bobcopeland.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, Bob Copeland To: Bob Copeland Return-path: Received: from outpipe-village-512-1.bc.nu ([81.2.110.250]:51693 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754814AbYDMJWF (ORCPT ); Sun, 13 Apr 2008 05:22:05 -0400 In-Reply-To: <1208041121-26787-3-git-send-email-me@bobcopeland.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > + * so we have to walk the tree. Both inodes and file data are allocated > + * from the same map. This array can be big (300k) so we allocate > + * in units of the blocksize. sbi->s_num_blocks doesn't appear to be validated at the time of mount ? > +static int omfs_fill_super(struct super_block *sb, void *data, int silent) > +{ > + sbi->s_num_blocks = be64_to_cpu(omfs_sb->s_num_blocks); > + sbi->s_blocksize = be32_to_cpu(omfs_sb->s_blocksize); > + sbi->s_mirrors = be32_to_cpu(omfs_sb->s_mirrors); > + sbi->s_root_ino = be64_to_cpu(omfs_sb->s_root_block); > + sbi->s_sys_blocksize = be32_to_cpu(omfs_sb->s_sys_blocksize); Several of these look like they should be checked before use elsewhere in the code (eg blocksize is fed into shifts later)