Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751053AbVJJXjJ (ORCPT ); Mon, 10 Oct 2005 19:39:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751177AbVJJXjJ (ORCPT ); Mon, 10 Oct 2005 19:39:09 -0400 Received: from tux06.ltc.ic.unicamp.br ([143.106.24.50]:43685 "EHLO tux06.ltc.ic.unicamp.br") by vger.kernel.org with ESMTP id S1751053AbVJJXjH (ORCPT ); Mon, 10 Oct 2005 19:39:07 -0400 Date: Mon, 10 Oct 2005 20:49:13 -0300 From: Glauber de Oliveira Costa To: Mikulas Patocka Cc: glommer@br.ibm.com, Anton Altaparmakov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ext2-devel@lists.sourceforge.net, hirofumi@mail.parknet.co.jp, linux-ntfs-dev@lists.sourceforge.net, aia21@cantab.net, hch@infradead.org, viro@zeniv.linux.org.uk, akpm@osdl.org Subject: Re: [PATCH] Use of getblk differs between locations Message-ID: <20051010234913.GB13399@br.ibm.com> References: <20051010204517.GA30867@br.ibm.com> <20051010214605.GA11427@br.ibm.com> <20051010231242.GC11427@br.ibm.com> <20051010233344.GA13399@br.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1204 Lines: 33 > >In the code, we see: > > > >if (unlikely(size & (bdev_hardsect_size(bdev)-1) || > > (size < 512 || size > PAGE_SIZE))) { > > > >This is where __getblk_slow, and thus, __getblk fails, and it does not > >seem to be due to any memory management bug. > > This is a filesystem bug --- filesystem should set it's blocksize with > sb_set_blocksize (and refuse to mount if the device doesn't support it) > before using it in requests. > > Mikulas > No doubt about it. But in case it does not, or in the case the value gets corrupted after the check but before the call, it will lead some code to dereferencing a NULL pointer, and making the whole system crash for a silly thing. So, for me, checking for the value after the call to __getblk does seem the right approach. -- ===================================== Glauber de Oliveira Costa IBM Linux Technology Center - Brazil glommer@br.ibm.com ===================================== - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/