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: <1187367307.6114.129.camel@twins>
Date:	Fri, 17 Aug 2007 18:15:07 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Josef Sipek <jsipek@....cs.sunysb.edu>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	miklos@...redi.hu, akpm@...ux-foundation.org, neilb@...e.de,
	dgc@....com, tomoki.sekiyama.qu@...achi.com, nikita@...sterfs.com,
	trond.myklebust@....uio.no, yingchao.zhou@...il.com,
	richard@....demon.co.uk, torvalds@...ux-foundation.org
Subject: Re: [PATCH 11/23] mm: bdi init hooks

On Fri, 2007-08-17 at 12:10 -0400, Josef Sipek wrote:
> On Thu, Aug 16, 2007 at 09:45:36AM +0200, Peter Zijlstra wrote:
> > provide BDI constructor/destructor hooks
> ....
> > Index: linux-2.6/drivers/block/rd.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/block/rd.c
> > +++ linux-2.6/drivers/block/rd.c
> ....
> > @@ -419,7 +422,19 @@ static void __exit rd_cleanup(void)
> >  static int __init rd_init(void)
> >  {
> >  	int i;
> > -	int err = -ENOMEM;
> > +	int err;
> > +
> > +	err = bdi_init(&rd_backing_dev_info);
> > +	if (err)
> > +		goto out2;
> > +
> > +	err = bdi_init(&rd_file_backing_dev_info);
> > +	if (err) {
> > +		bdi_destroy(&rd_backing_dev_info);
> > +		goto out2;
> 
> How about this...

seems like a sane idea.

> if (err)
> 	goto out3;
> 
> > +	}
> > +
> > +	err = -ENOMEM;
> >  
> >  	if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 ||
> >  			(rd_blocksize & (rd_blocksize-1))) {
> > @@ -473,6 +488,9 @@ out:
> >  		put_disk(rd_disks[i]);
> >  		blk_cleanup_queue(rd_queue[i]);
> >  	}
> > +	bdi_destroy(&rd_backing_dev_info);
> > +	bdi_destroy(&rd_file_backing_dev_info);
> 
> 	bdi_destroy(&rd_file_backing_dev_info);
> out3:
> 	bdi_destroy(&rd_backing_dev_info);
> 
> Sure you might want to switch from numbered labels to something a bit more
> descriptive.

I was just keeping in style here.

Thanks for looking this over, all these error paths did make my head
spin a little.

Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ