lkml.org 
[lkml]   [2011]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysctl: Add the kernel.ns_last_pid control
On Mon, Nov 28, 2011 at 07:21:25PM +0400, Pavel Emelyanov wrote:
> +static int pid_ns_ctl_handler(struct ctl_table *table, int write,
> + void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> + struct ctl_table tmp = *table;
> +
> + if (write && !capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
> + /*
> + * Writing directly to ns' last_pid field is OK, since this field
> + * is volatile in a living namespace anyway and a code writing to
> + * it should synchronize its usage with external means.
> + */

I would still prefer using set_last_pid() but if you insist to update
last_pid directly, please note the direct update in the comment on top
of set_last_pid() too.

Other than that,

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

--
tejun


\
 
 \ /
  Last update: 2011-11-28 16:55    [W:0.057 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site