lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1157491179.19432.11.camel@kleikamp.austin.ibm.com>
Date:	Tue, 05 Sep 2006 16:19:39 -0500
From:	Dave Kleikamp <shaggy@...tin.ibm.com>
To:	Badari Pulavarty <pbadari@...ibm.com>
Cc:	Badari Pulavarty <pbadari@...il.com>,
	Will Simoneau <simoneau@....uri.edu>,
	lkml <linux-kernel@...r.kernel.org>,
	ext4 <linux-ext4@...r.kernel.org>
Subject: Re: BUG: warning at fs/ext3/inode.c:1016/ext3_getblk()

On Tue, 2006-09-05 at 13:14 -0700, Badari Pulavarty wrote:
> Dave Kleikamp wrote:

> > I'm having a hard time figuring out exactly what ext3_get_blocks_handle
> > is trying to return, but it looks to me like if it is allocating one
> > data block, and needs to allocate an indirect block as well, then it
> > will return 2 rather than 1.  Is this expected, or am I just confused?
> >
> >   
> 
> It would return "1" in that case.. (data block)
> 
>  > 0 means get_block() suceeded and indicates the number of blocks mapped
> = 0 lookup failed
> < 0 mean error case

Okay, I got confused looking through the code.  I still don't see how
ext3_get_blocks_handle() should be returning a number greater than
maxblocks.

> >> I did search for callers of ext3_get_blocks_handle() and found that
> >> ext3_readdir() seems to do wrong thing all the time with error check :(
> >> Need to take a closer look..
> >>
> >> 	err = ext3_get_blocks_handle(NULL, inode, blk, 1,
> >>                                                 &map_bh, 0, 0);
> >>         if (err > 0) {  <<<< BAD
> >>                   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);
> >>        }
> >>     
> >
> > Bad to do what it's doing, or bad to call name the variable "err"?
> > I think if it looked like this:
> >
> > 	count = ext3_get_blocks_handle(NULL, inode, blk, 1,
> >                                                 &map_bh, 0, 0);
> >         if (count > 0) { 
> >
> > it would be a lot less confusing.
> >   
> I am sorry !! it is doing the right thing :(

Not your fault.  The variable is very badly named.
-- 
David Kleikamp
IBM Linux Technology Center

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ