[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1187366597.6114.127.camel@twins>
Date: Fri, 17 Aug 2007 18:03:16 +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 09/23] lib: percpu_counter_init error handling
On Fri, 2007-08-17 at 11:56 -0400, Josef Sipek wrote:
> On Thu, Aug 16, 2007 at 09:45:34AM +0200, Peter Zijlstra wrote:
> )
> > @@ -996,12 +997,16 @@ static int ext2_fill_super(struct super_
> > sbi->s_rsv_window_head.rsv_goal_size = 0;
> > ext2_rsv_window_add(sb, &sbi->s_rsv_window_head);
> >
> > - percpu_counter_init(&sbi->s_freeblocks_counter,
> > + err = percpu_counter_init(&sbi->s_freeblocks_counter,
> > ext2_count_free_blocks(sb));
> > - percpu_counter_init(&sbi->s_freeinodes_counter,
> > + err |= percpu_counter_init(&sbi->s_freeinodes_counter,
> > ext2_count_free_inodes(sb));
> > - percpu_counter_init(&sbi->s_dirs_counter,
> > + err |= percpu_counter_init(&sbi->s_dirs_counter,
> > ext2_count_dirs(sb));
> > + if (err) {
> > + printk(KERN_ERR "EXT2-fs: insufficient memory\n");
> > + goto failed_mount3;
> > + }
>
> Can percpu_counter_init fail with only one error code? If not, the error
> code potentially used in future at failed_mount3 could be nonsensical
> because of the bitwise or-ing.
I guess I could have written saner code :-/ will try to come up with
something that is both clear and short.
Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)
Powered by blists - more mailing lists