From owner-svn-src-all@FreeBSD.ORG Tue Jun 8 16:05:04 2010 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 416D3106567A; Tue, 8 Jun 2010 16:05:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 19FE98FC0C; Tue, 8 Jun 2010 16:05:04 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8987546BC2; Tue, 8 Jun 2010 12:05:03 -0400 (EDT) Date: Tue, 8 Jun 2010 17:05:03 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <20100607200743.GB4468@garage.freebsd.pl> Message-ID: References: <201006061611.o56GBHbE089883@svn.freebsd.org> <20100607200743.GB4468@garage.freebsd.pl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208876 - head/sys/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, 08 Jun 2010 16:05:04 -0000 On Mon, 7 Jun 2010, Pawel Jakub Dawidek wrote: >> 1) Further enhance the INVARIANT lock validation (no locks) are >> held by checking the create and inp locks as well. > [...] >> + if (mtx_owned(&inp->inp_create_mtx)) { >> + panic("Own create lock on inp"); >> + } >> + if (mtx_owned(&inp->inp_mtx)) { >> + panic("Own inp lock on inp"); >> + } > > If you replace this with: > > mtx_assert(&inp->inp_create_mtx, MA_NOTOWNED); > mtx_assert(&inp->inp_mtx, MA_NOTOWNED); > > But the kernel has to be compiled with INVARIANTS to make it work. It might be worth mimicking the locking assertions from in_pcb.h, even though these data structures are different. Robert