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]
Date:	Fri, 4 Jun 2010 08:19:06 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Borislav Petkov <bp@...en8.de>, Changli Gao <xiaosuo@...il.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] fs: optimize mpage_readpage()

On Sat, May 29, 2010 at 02:10:19PM +0200, Borislav Petkov wrote:
> > -	struct bio *bio = NULL;
> > +	struct bio *bio;
> >  	sector_t last_block_in_bio = 0;
> >  	struct buffer_head map_bh;
> >  	unsigned long first_logical_block = 0;
> >  
> >  	map_bh.b_state = 0;
> >  	map_bh.b_size = 0;
> > -	bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio,
> > +	bio = do_mpage_readpage(NULL, page, 1, &last_block_in_bio,
> >  			&map_bh, &first_logical_block, get_block);
> >  	if (bio)
> >  		mpage_bio_submit(READ, bio);
> 
> Nope, I don't think that's a good idea.
> 
> On the one hand, this is a trick to shut up gcc:
> 
> fs/mpage.c: In function ???mpage_readpage???:
> fs/mpage.c:419: warning: ???bio??? is used uninitialized in this function

File a bug against your version of gcc, then.  The very first operation
involving bio is assignment to it; if gcc complains about that, it's
extremely fscked up.

Said that, I don't see how could that be an optimization.  Recent gcc is
apparently b0rken in dead stores elimination, but that seems to be
triggered by passing address of variable to another function later on [1];
nothing of that kind happens here.

[1] gcc 4.3 and later (at least) fails to eliminate the first assignment in
int foo(void)
{
	extern int f(void);
	extern int g(int *);
	int x;
	x = 0;
	x = f();
	return g(&x);
}
with any optimization level (and apparently on any target).
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ