From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:12:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029FF1065692; Tue, 11 Nov 2008 17:12:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F28CC8FC20; Tue, 11 Nov 2008 17:12:26 +0000 (UTC) (envelope-from rwatson@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 mABHCQVM007374; Tue, 11 Nov 2008 17:12:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mABHCQZK007373; Tue, 11 Nov 2008 17:12:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811111712.mABHCQZK007373@svn.freebsd.org> From: Robert Watson Date: Tue, 11 Nov 2008 17:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184853 - in stable/7/sys: . modules/cxgb netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 17:12:27 -0000 Author: rwatson Date: Tue Nov 11 17:12:26 2008 New Revision: 184853 URL: http://svn.freebsd.org/changeset/base/184853 Log: Merge r184304 from head to stable/7: In both dropwithreset paths in tcp_input.c, drop the tcbinfo lock sooner to decomplicate locking and eliminate the need for a rather chatty comment about why we have to handle the global lock in a special way for the benefit of ipfw and pf cred rules. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/modules/cxgb/ (props changed) stable/7/sys/netinet/tcp_input.c Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Tue Nov 11 17:10:24 2008 (r184852) +++ stable/7/sys/netinet/tcp_input.c Tue Nov 11 17:12:26 2008 (r184853) @@ -849,19 +849,12 @@ findpcb: dropwithreset: INP_INFO_WLOCK_ASSERT(&tcbinfo); + INP_INFO_WUNLOCK(&tcbinfo); - /* - * If inp is non-NULL, we call tcp_dropwithreset() holding both inpcb - * and global locks. However, if NULL, we must hold neither as - * firewalls may acquire the global lock in order to look for a - * matching inpcb. - */ if (inp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); INP_WUNLOCK(inp); - } - INP_INFO_WUNLOCK(&tcbinfo); - if (inp == NULL) + } else tcp_dropwithreset(m, th, NULL, tlen, rstreason); m = NULL; /* mbuf chain got consumed. */ goto drop; @@ -2414,19 +2407,12 @@ dropafterack: dropwithreset: KASSERT(headlocked, ("%s: dropwithreset: head not locked", __func__)); + INP_INFO_WUNLOCK(&tcbinfo); - /* - * If tp is non-NULL, we call tcp_dropwithreset() holding both inpcb - * and global locks. However, if NULL, we must hold neither as - * firewalls may acquire the global lock in order to look for a - * matching inpcb. - */ if (tp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); INP_WUNLOCK(tp->t_inpcb); - } - INP_INFO_WUNLOCK(&tcbinfo); - if (tp == NULL) + } else tcp_dropwithreset(m, th, NULL, tlen, rstreason); return;