From owner-cvs-all@FreeBSD.ORG Wed Feb 9 15:14:44 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0FB916A4CE; Wed, 9 Feb 2005 15:14:44 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B21C043D46; Wed, 9 Feb 2005 15:14:44 +0000 (GMT) (envelope-from ru@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j19FEi8W088088; Wed, 9 Feb 2005 15:14:44 GMT (envelope-from ru@repoman.freebsd.org) Received: (from ru@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j19FEiZM088086; Wed, 9 Feb 2005 15:14:44 GMT (envelope-from ru) Message-Id: <200502091514.j19FEiZM088086@repoman.freebsd.org> From: Ruslan Ermilov Date: Wed, 9 Feb 2005 15:14:44 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/netgraph ng_bridge.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Feb 2005 15:14:45 -0000 ru 2005-02-09 15:14:44 UTC FreeBSD src repository Modified files: sys/netgraph ng_bridge.c Log: In revision 1.29 timeout() was converted to ng_callout(). The difference is that the callout function installed via the ng_callout() method is guaranteed to NOT fire after the shutdown method was run (when a node is marked NGF_INVALID). Also, the shutdown method and the callout function are guaranteed to NOT run at the same time, as both require the writer lock. Thus we can safely ignore a zero return value from ng_uncallout() (callout_stop()) in shutdown methods, and go on with freeing the node. The said revision broke the node shutdown -- ng_bridge_timeout() is no longer fired after ng_bridge_shutdown() was run, resulting in a memory leak, dead nodes, and inability to unload the module. Fix this by cancelling the callout on shutdown, and moving part responsible for freeing a node resources from ng_bridge_timer() to ng_bridge_shutdown(). Noticed by: ru Submitted by: glebius, ru Revision Changes Path 1.31 +9 -15 src/sys/netgraph/ng_bridge.c