lkml.org 
[lkml]   [2009]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] extend get/setrlimit to support setting rlimits external to a process (v7)
On Mon, Nov 02, 2009 at 04:10:32PM +0100, Ingo Molnar wrote:
>
> two small comments:
>
> this is a really dangerous pattern:
>
> > + if (!lock_task_sighand(tsk, &flags))
> > + goto out_put_all;
> > +
>
> as it's followed by:
>
> > + else {
> > + struct rlimit val;
> > +
> > + task_lock(tsk->group_leader);
> > + val = current->signal->rlim[resource];
> > + task_unlock(tsk->group_leader);
> > + retval = copy_to_user(rlim, &val, sizeof(*rlim)) ? -EFAULT : 0;
> > + }
>
> please turn that into the regular:
>
> if () {
> ...
> } else {
> ...
> }
>
> pattern that is a lot harder to mess up later on.
>
Yeah, ok, I can do that.

> > + return retval;
> > +}
> > +
> > +
> > #ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
>
> one too many newlines?
>
Probably, I'll trim it. Thanks.
Neil

> Ingo
>


\
 
 \ /
  Last update: 2009-11-02 18:43    [W:0.120 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site