Re: [PATCH 2/3] extend get/setrlimit to support setting rlimitsexternal to a process (v7)

From: Ingo Molnar
Date: Mon Nov 02 2009 - 10:10:57 EST



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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/