PERFORCE change 124458 for review

Julian Elischer julian at elischer.org
Wed Aug 1 19:23:43 UTC 2007


Marko Zec wrote:
> http://perforce.freebsd.org/chv.cgi?CH=124458
> 
> Change 124458 by zec at zec_tpx32 on 2007/08/01 12:04:48
> 
> 	Per Julian's suggestion, if a netgraph node won't die, try
> 	to kill it with NGF_REALLY_DIE flag set.
> 	
> 	IMO this should never happen given that no netgraph nodes
> 	associated with any physical hardware should be present in
> 	a dying vnet at this point, so print out a warning if we ever
> 	encounter such an event, in which case it will need more work
> 	and inspection, otherwise we could leak hardware devices on
> 	vnet shutdown.
> 

you might just always set this bit the first time around..

> Affected files ...
> 
> .. //depot/projects/vimage/src/sys/netgraph/ng_base.c#14 edit
> 
> Differences ...
> 
> ==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#14 (text+ko) ====
> 
> @@ -3222,8 +3222,17 @@
>  	node_p node, last_killed = NULL;
>  
>  	while ((node = LIST_FIRST(&V_ng_nodelist)) != NULL) {
> -		if (node == last_killed)
> -			panic("netgraph node %s won't die", node->nd_name);
> +		if (node == last_killed) {
> +			/* This should never happen */
> +			node->nd_flags |= NGF_REALLY_DIE;
> +			printf("netgraph node %s needs NGF_REALLY_DIE",
> +			    node->nd_name);
> +			ng_rmnode(node, NULL, NULL, 0);
> +			/* This must never happen */
> +			if (node == LIST_FIRST(&V_ng_nodelist))
> +				panic("netgraph node %s won't die",
> +				    node->nd_name);
> +		}
>  		ng_rmnode(node, NULL, NULL, 0);
>  		last_killed = node;
>  	}



More information about the p4-projects mailing list