Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Apr 2011 23:45:42 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Marko Zec <zec@FreeBSD.org>, julian@FreeBSD.org
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r220416 - head/sys/netgraph
Message-ID:  <20110407194542.GZ84445@FreeBSD.org>
In-Reply-To: <201104071615.49994.zec@freebsd.org>
References:  <201104071140.p37BeAlE039248@svn.freebsd.org> <20110407135440.GX84445@FreeBSD.org> <201104071615.49994.zec@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 07, 2011 at 04:15:49PM +0200, Marko Zec wrote:
M> On Thursday 07 April 2011 15:54:40 Gleb Smirnoff wrote:
M> > On Thu, Apr 07, 2011 at 11:40:10AM +0000, Marko Zec wrote:
M> > M> Author: zec
M> > M> Date: Thu Apr  7 11:40:10 2011
M> > M> New Revision: 220416
M> > M> URL: http://svn.freebsd.org/changeset/base/220416
M> > M>
M> > M> Log:
M> > M>   Properly unref ng_hub nodes on shutdown, so that we don't leak them.
M> > M>
M> > M>   MFC after:	3 days
M> > M>
M> > M> Modified:
M> > M>   head/sys/netgraph/ng_hub.c
M> > M>
M> > M> Modified: head/sys/netgraph/ng_hub.c
M> > M>
M> > ===========================================================================
M> >=== M> --- head/sys/netgraph/ng_hub.c	Thu Apr  7 11:13:50 2011	(r220415) M>
M> > +++ head/sys/netgraph/ng_hub.c	Thu Apr  7 11:40:10 2011	(r220416) M> @@
M> > -157,6 +157,8 @@ ng_hub_shutdown(node_p node)
M> > M>  	const priv_p priv = NG_NODE_PRIVATE(node);
M> > M>
M> > M>  	free(priv, M_NETGRAPH_HUB);
M> > M> +	NG_NODE_SET_PRIVATE(node, NULL);
M> > M> +	NG_NODE_UNREF(node);
M> > M>  	return (0);
M> > M>  }
M> >
M> > Do we really need NG_NODE_SET_PRIVATE()?
M> 
M> Most probably not, though the majority of .shutdown method implementations in 
M> sys/netgraph do include a call to NG_NODE_SET_PRIVATE(node, NULL), so I did a 
M> C/P from one of those for consistency.  If there's a consensus that 
M> NG_NODE_SET_PRIVATE(node, NULL) in shutdown methods serves no useful purpose 
M> then we should do a sweep across all the existing nodes...

My humble opinion is that they should be swept. At least to avoid more c/p
in future.

Julian?

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110407194542.GZ84445>