Re: [RFC 1/5] user namespaces: Add a user_namespace ascreator/owner of uts_namespace

From: Serge Hallyn
Date: Fri Dec 17 2010 - 11:17:19 EST


Quoting Alexey Dobriyan (adobriyan@xxxxxxxxx):
> On Fri, Dec 17, 2010 at 5:56 PM, Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
> > On Fri, Dec 17, 2010 at 5:24 PM, Serge E. Hallyn <serge@xxxxxxxxxx> wrote:
> >> +/*
> >> + * userns count is 1 for root user, 1 for init_uts_ns,
> >> + * and 1 for... ?
> >> + */
> >>  struct user_namespace init_user_ns = {
> >>        .kref = {
> >> -               .refcount       = ATOMIC_INIT(2),
> >> +               .refcount       = ATOMIC_INIT(3),
> >
> > +1 is for init_nsproxy ;-)
>
> Err, no.
>
> +1 is to ensure it's never freed, but since allocator will BUG_ON (?) if fed
> with static object, maybe it's completely bogus.

Right. On the one hand so long as it's high enough it doesn't really matter.
But I think it's worth getting the # exactly right in order to help document
what's going on. So I'll try dropping it back down to 2.

thanks,
-serge
--
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/