From owner-svn-src-head@FreeBSD.ORG Thu Apr 7 14:27:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4ADA1065672; Thu, 7 Apr 2011 14:27:59 +0000 (UTC) (envelope-from zec@freebsd.org) Received: from munja.zvne.fer.hr (munja.zvne.fer.hr [161.53.66.248]) by mx1.freebsd.org (Postfix) with ESMTP id 007308FC15; Thu, 7 Apr 2011 14:27:58 +0000 (UTC) Received: from sluga.fer.hr ([161.53.66.244]) by munja.zvne.fer.hr with Microsoft SMTPSVC(6.0.3790.4675); Thu, 7 Apr 2011 16:15:54 +0200 Received: from localhost ([161.53.19.8]) by sluga.fer.hr with Microsoft SMTPSVC(6.0.3790.4675); Thu, 7 Apr 2011 16:15:53 +0200 From: Marko Zec To: Gleb Smirnoff Date: Thu, 7 Apr 2011 16:15:49 +0200 User-Agent: KMail/1.9.10 References: <201104071140.p37BeAlE039248@svn.freebsd.org> <20110407135440.GX84445@FreeBSD.org> In-Reply-To: <20110407135440.GX84445@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201104071615.49994.zec@freebsd.org> X-OriginalArrivalTime: 07 Apr 2011 14:15:53.0828 (UTC) FILETIME=[4E210A40:01CBF52E] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220416 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2011 14:27:59 -0000 On Thursday 07 April 2011 15:54:40 Gleb Smirnoff wrote: > On Thu, Apr 07, 2011 at 11:40:10AM +0000, Marko Zec wrote: > M> Author: zec > M> Date: Thu Apr 7 11:40:10 2011 > M> New Revision: 220416 > M> URL: http://svn.freebsd.org/changeset/base/220416 > M> > M> Log: > M> Properly unref ng_hub nodes on shutdown, so that we don't leak them. > M> > M> MFC after: 3 days > M> > M> Modified: > M> head/sys/netgraph/ng_hub.c > M> > M> Modified: head/sys/netgraph/ng_hub.c > M> > =========================================================================== >=== M> --- head/sys/netgraph/ng_hub.c Thu Apr 7 11:13:50 2011 (r220415) M> > +++ head/sys/netgraph/ng_hub.c Thu Apr 7 11:40:10 2011 (r220416) M> @@ > -157,6 +157,8 @@ ng_hub_shutdown(node_p node) > M> const priv_p priv = NG_NODE_PRIVATE(node); > M> > M> free(priv, M_NETGRAPH_HUB); > M> + NG_NODE_SET_PRIVATE(node, NULL); > M> + NG_NODE_UNREF(node); > M> return (0); > M> } > > Do we really need NG_NODE_SET_PRIVATE()? Most probably not, though the majority of .shutdown method implementations in sys/netgraph do include a call to NG_NODE_SET_PRIVATE(node, NULL), so I did a C/P from one of those for consistency. If there's a consensus that NG_NODE_SET_PRIVATE(node, NULL) in shutdown methods serves no useful purpose then we should do a sweep across all the existing nodes... Marko