[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091102151032.GF23776@elte.hu>
Date: Mon, 2 Nov 2009 16:10:32 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Neil Horman <nhorman@...driver.com>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
marcin.slusarz@...il.com, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com
Subject: Re: [PATCH 2/3] extend get/setrlimit to support setting rlimits
external to a process (v7)
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.
> + return retval;
> +}
> +
> +
> #ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
one too many newlines?
Ingo
--
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