Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064Ab2JJJWF (ORCPT ); Wed, 10 Oct 2012 05:22:05 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:45623 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753109Ab2JJJWB (ORCPT ); Wed, 10 Oct 2012 05:22:01 -0400 Date: Wed, 10 Oct 2012 13:21:56 +0400 From: Cyrill Gorcunov To: Xiaotian Feng Cc: Greg KH , Andrew Morton , Andrew Vagin , linux-kernel@vger.kernel.org, criu@openvz.org, Pavel Emelyanov , "Eric W. Biederman" Subject: Re: [PATCH] pidns: remove recursion from free_pid_ns (v3) Message-ID: <20121010092156.GC25536@moon> References: <1349553393-902065-1-git-send-email-avagin@openvz.org> <20121009114821.dc4c2aff.akpm@linux-foundation.org> <20121009190300.GB22108@kroah.com> <20121009120831.8a6d81d8.akpm@linux-foundation.org> <20121010074923.GA11894@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 941 Lines: 24 On Wed, Oct 10, 2012 at 05:12:21PM +0800, Xiaotian Feng wrote: > > > > Is a kref even the correct thing here? > > Can we fix this by this way? free_pid_ns just release ns itself, we check > the return value of kref_put, if kref_put returns 1, means ns->kref is removed, > then we kref_put(ns->parent). > > diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h > index 00474b0..2168535 100644 > --- a/include/linux/pid_namespace.h > +++ b/include/linux/pid_namespace.h > @@ -53,8 +53,14 @@ extern int reboot_pid_ns(struct pid_namespace > *pid_ns, int cmd); > I've sent the similar patch yesterday, thanks. http://www.mail-archive.com/stable@vger.kernel.org/msg19471.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/