[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87halhfms4.fsf@xmission.com>
Date: Tue, 12 Feb 2013 09:46:19 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Tim Gardner <tim.gardner@...onical.com>
Cc: linux-kernel@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH linux-next] befs: befs_fill_super(): remove unreachable code
Tim Gardner <tim.gardner@...onical.com> writes:
> befs_sb->num_blocks is of base type u64 which is the same as sector_t.
> Therefore, num_blocks can never be larger then the maximum
> value of sector_t.
The analysys is wrong. On 32bit with CONFIG_LBAF unset sector_t is an
unsigned long aka a u32, while befs_off_t is always a u64.
Nacked-by: "Eric W. Biederman" <ebiederm@...ssion.com>
> smatch analysis:
>
> fs/befs/linuxvfs.c:851 befs_fill_super() warn: impossible
> condition '(befs_sb->num_blocks > ~(0)) => (0-u64max > u64max)'
>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
> Signed-off-by: Tim Gardner <tim.gardner@...onical.com>
> ---
> fs/befs/linuxvfs.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
> index 2b3bda8..2ce5705 100644
> --- a/fs/befs/linuxvfs.c
> +++ b/fs/befs/linuxvfs.c
> @@ -848,13 +848,6 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
> if (befs_check_sb(sb) != BEFS_OK)
> goto unacquire_priv_sbp;
>
> - if( befs_sb->num_blocks > ~((sector_t)0) ) {
> - befs_error(sb, "blocks count: %Lu "
> - "is larger than the host can use",
> - befs_sb->num_blocks);
> - goto unacquire_priv_sbp;
> - }
> -
> /*
> * set up enough so that it can read an inode
> * Fill in kernel superblock fields from private sb
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists