From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Kleikamp Subject: Re: I think I find a bug in ext3/dir.c Date: Tue, 31 Oct 2006 09:23:45 -0600 Message-ID: <1162308225.12059.4.camel@kleikamp.austin.ibm.com> References: <200610311235.k9VCZZHv002689@nrchpc.ac.cn> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: "linux-fsdevel@vger.kernel.org" Return-path: Received: from e5.ny.us.ibm.com ([32.97.182.145]:30944 "EHLO e5.ny.us.ibm.com") by vger.kernel.org with ESMTP id S1423485AbWJaPXz (ORCPT ); Tue, 31 Oct 2006 10:23:55 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.13.8/8.12.11) with ESMTP id k9VFNsfP026344 for ; Tue, 31 Oct 2006 10:23:54 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k9VFNm7G291930 for ; Tue, 31 Oct 2006 10:23:48 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k9VFNliH002416 for ; Tue, 31 Oct 2006 10:23:48 -0500 To: guomingyang@nrchpc.ac.cn In-Reply-To: <200610311235.k9VCZZHv002689@nrchpc.ac.cn> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2006-10-31 at 20:23 +0800, guomingyang wrote: > Hello everyone > > I think I find a bug in ext3_readdir > > if (err > 0) { > page_cache_readahead(sb->s_bdev->bd_inode->i_mapping, > &filp->f_ra, > filp, > map_bh.b_blocknr >> > (PAGE_CACHE_SHIFT - inode->i_blkbits), > 1); > bh = ext3_bread(NULL, inode, blk, 0, &err); > } > map_bh.b_blocknr is the physical number of a block, but > page_cache_readahead need a file-relative block number, am I right? This is true, but the block-device inode, bd_inode, is trivially mapped such that the physical block and the logical block are the same. So it's not a bug. Directories don't have a logical mapping. They use the block device's address space. -- David Kleikamp IBM Linux Technology Center