On 10/09, Greg KH wrote:
>
> > +static inline int __kref_put(struct kref *kref)
> > +{
> > +   return atomic_dec_and_test(&kref->refcount);
> > +}
>
> No, this isn't ok, what happened to the release function?  Why is this
> needed?

To avoid the recursion. ->release was already called.

> > --- a/kernel/pid_namespace.c~pidns-remove-recursion-from-free_pid_ns-v3
> > +++ a/kernel/pid_namespace.c
> > @@ -139,11 +139,19 @@ void free_pid_ns(struct kref *kref)
> >
> >     ns = container_of(kref, struct pid_namespace, kref);
> >
> > -   parent = ns->parent;
> > -   destroy_pid_namespace(ns);
> > +   while (1) {
> > +           parent = ns->parent;
> > +           destroy_pid_namespace(ns);
> >
> > -   if (parent != NULL)
> > -           put_pid_ns(parent);
> > +           if (parent == &init_pid_ns)
> > +                   break;
> > +
> > +           /* kref_put cannot be used for avoiding recursion */
> > +           if (__kref_put(&parent->kref) == 0)
> > +                   break;
>
> Someone is abusing something here, please don't change the kref api to
> work around someone using it improperly.
>
> So no, please don't apply this at all.

Because this is wrong or because not kosher?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to