From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 20:21:58 2008 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 4B6EF1065675; Mon, 8 Dec 2008 20:21:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0228FC16; Mon, 8 Dec 2008 20:21:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB8KLvoS069708; Mon, 8 Dec 2008 20:21:57 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB8KLvkr069707; Mon, 8 Dec 2008 20:21:57 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812082021.mB8KLvkr069707@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Dec 2008 20:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185774 - head/sys/net 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: Mon, 08 Dec 2008 20:21:58 -0000 Author: kmacy Date: Mon Dec 8 20:21:57 2008 New Revision: 185774 URL: http://svn.freebsd.org/changeset/base/185774 Log: - avoid recursively locking the radix node head lock - assert that it is held if RTF_RNH_LOCKED is not passed Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Dec 8 20:18:50 2008 (r185773) +++ head/sys/net/route.c Mon Dec 8 20:21:57 2008 (r185774) @@ -866,7 +866,7 @@ rtexpunge(struct rtentry *rt) * Now search what's left of the subtree for any cloned * routes which might have been formed from this node. */ - if ((rt->rt_flags & RTF_CLONING) && rt_mask(rt)) + if ((rt->rt_flags & RTF_CLONING) && rt_mask(rt)) rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), rt_fixdelete, rt); @@ -935,6 +935,8 @@ rtrequest1_fib(int req, struct rt_addrin flags &= ~RTF_RNH_LOCKED; if (needlock) RADIX_NODE_HEAD_LOCK(rnh); + else + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); /* * If we are adding a host route then we don't want to put * a netmask in the tree, nor do we want to clone it. @@ -1277,7 +1279,7 @@ rt_fixdelete(struct radix_node *rn, void if (rt->rt_parent == rt0 && !(rt->rt_flags & (RTF_PINNED | RTF_CLONING))) { return rtrequest_fib(RTM_DELETE, rt_key(rt), NULL, rt_mask(rt), - rt->rt_flags, NULL, rt->rt_fibnum); + rt->rt_flags|RTF_RNH_LOCKED, NULL, rt->rt_fibnum); } return 0; }