Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2007 12:04:56 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 124458 for review
Message-ID:  <200708011204.l71C4uW1001086@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124458

Change 124458 by zec@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.

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;
 	}



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