Date: Mon, 8 Dec 2008 20:21:57 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r185774 - head/sys/net Message-ID: <200812082021.mB8KLvkr069707@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812082021.mB8KLvkr069707>