linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I think I find a bug in ext3/dir.c
@ 2006-10-31 12:23 guomingyang
  2006-10-31 15:23 ` Dave Kleikamp
  0 siblings, 1 reply; 2+ messages in thread
From: guomingyang @ 2006-10-31 12:23 UTC (permalink / raw)
  To: linux-fsdevel@vger.kernel.org

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: I think I find a bug in ext3/dir.c
  2006-10-31 12:23 I think I find a bug in ext3/dir.c guomingyang
@ 2006-10-31 15:23 ` Dave Kleikamp
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Kleikamp @ 2006-10-31 15:23 UTC (permalink / raw)
  To: guomingyang; +Cc: 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-31 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-31 12:23 I think I find a bug in ext3/dir.c guomingyang
2006-10-31 15:23 ` Dave Kleikamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).