From owner-freebsd-stable@FreeBSD.ORG Sat Mar 22 15:56:51 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C473A1065675 for ; Sat, 22 Mar 2008 15:56:51 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by mx1.freebsd.org (Postfix) with ESMTP id 5FAF58FC1E for ; Sat, 22 Mar 2008 15:56:51 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-001-036.pools.arcor-ip.net [88.66.1.36]) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis) id 0MKwh2-1Jd65R01mM-0008PD; Sat, 22 Mar 2008 16:56:49 +0100 Received: (qmail 49744 invoked from network); 22 Mar 2008 15:56:03 -0000 Received: from myhost.laiers.local (192.168.4.151) by mx.laiers.local with SMTP; 22 Mar 2008 15:56:03 -0000 From: Max Laier Organization: FreeBSD To: Alex Popa Date: Sat, 22 Mar 2008 16:55:28 +0100 User-Agent: KMail/1.9.7 References: <20080314192359.GA4677@dataxnet.ro> <200803152217.02568.max@love2party.net> <20080322102933.GA76747@dataxnet.ro> In-Reply-To: <20080322102933.GA76747@dataxnet.ro> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_wvS5Hdzr8z13U66" Message-Id: <200803221655.28975.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1/v5WXM4ReteacTnmVpYFcrswHEMS+JCLwqXzR gnnhn1f737KYgKZtTyeojevU26mSAl0dm8JWz96rf4T5bcsFKS fpoAHJTxhbrwla2di5Jrg== Cc: Robert Watson , freebsd-stable@freebsd.org Subject: Re: Lock Order Reversal on 7.0-STABLE with pf and ipfw / dummynet (traces) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2008 15:56:51 -0000 --Boundary-00=_wvS5Hdzr8z13U66 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Alex, On Saturday 22 March 2008 11:29:33 Alex Popa wrote: > Sorry for the big delay, but here are the traces you requested. don't worry, you are a great help! Could you try the attached patch? I missed the fact that you are using FASTROUTE in your setup. There is obviously a problem with it, but the attached patch should work around that. The other LOR really is harmless and rather an oversight in WITNESS: a LOR with a shared/read lock can't cause a deadlock (unless there is also a LOR with the same lock in exclusive mode). But this is rather complex to check and might not be easily implemented in WITNESS. Anyways - I believe this patch should work around your problem. Let us know your findings - thanks. -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-00=_wvS5Hdzr8z13U66 Content-Type: text/x-diff; charset="utf-8"; name="pf_route.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pf_route.diff" Index: pf.c =================================================================== RCS file: /home/mlaier/fcvs/src/sys/contrib/pf/net/pf.c,v retrieving revision 1.51 diff -u -r1.51 pf.c --- pf.c 21 Nov 2007 10:12:52 -0000 1.51 +++ pf.c 22 Mar 2008 15:42:18 -0000 @@ -6106,7 +6106,13 @@ dst->sin_addr = ip->ip_dst; if (r->rt == PF_FASTROUTE) { +#ifdef __FreeBSD__ + PF_UNLOCK(); +#endif rtalloc(ro); +#ifdef __FreeBSD__ + PF_LOCK(); +#endif if (ro->ro_rt == 0) { ipstat.ips_noroute++; goto bad; --Boundary-00=_wvS5Hdzr8z13U66--