From owner-svn-src-head@FreeBSD.ORG Sat Jun 5 21:20:29 2010 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 26B5A106566B; Sat, 5 Jun 2010 21:20:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F06A48FC1A; Sat, 5 Jun 2010 21:20:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55LKSdH041092; Sat, 5 Jun 2010 21:20:28 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55LKSLA041089; Sat, 5 Jun 2010 21:20:28 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006052120.o55LKSLA041089@svn.freebsd.org> From: Randall Stewart Date: Sat, 5 Jun 2010 21:20:28 +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: r208853 - head/sys/netinet 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: Sat, 05 Jun 2010 21:20:29 -0000 Author: rrs Date: Sat Jun 5 21:20:28 2010 New Revision: 208853 URL: http://svn.freebsd.org/changeset/base/208853 Log: This does two changes: 1) Makes it so that the INVARIANT function validate nolocks is available anywhere. 2) Fixes a BUG where a close has been done on a collision socket and the cookie processing would return leaving a lock held. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.h Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jun 5 21:17:23 2010 (r208852) +++ head/sys/netinet/sctp_input.c Sat Jun 5 21:20:28 2010 (r208853) @@ -3067,7 +3067,7 @@ process_chunk_drop(struct sctp_tcb *stcb struct sctp_nets *net, uint8_t flg) { switch (desc->chunk_type) { - case SCTP_DATA: + case SCTP_DATA: /* find the tsn to resend (possibly */ { uint32_t tsn; @@ -4861,6 +4861,9 @@ process_control_chunks: } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } *offset = length; return (NULL); } @@ -5408,13 +5411,16 @@ sctp_process_ecn_marked_b(struct sctp_tc } #ifdef INVARIANTS -static void -sctp_validate_no_locks(struct sctp_inpcb *inp) +#ifdef __GNUC__ +__attribute__((noinline)) +#endif + void + sctp_validate_no_locks(struct sctp_inpcb *inp) { - struct sctp_tcb *stcb; + struct sctp_tcb *lstcb; - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&stcb->tcb_mtx)) { + LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { + if (mtx_owned(&lstcb->tcb_mtx)) { panic("Own lock on stcb at return from input"); } } Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sat Jun 5 21:17:23 2010 (r208852) +++ head/sys/netinet/sctp_pcb.h Sat Jun 5 21:20:28 2010 (r208853) @@ -621,5 +621,11 @@ sctp_initiate_iterator(inp_func inpf, struct sctp_inpcb *, uint8_t co_off); +#ifdef INVARIANTS +void + sctp_validate_no_locks(struct sctp_inpcb *inp); + +#endif + #endif /* _KERNEL */ #endif /* !__sctp_pcb_h__ */