Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 2010 17:05:03 +0100 (BST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, Randall Stewart <rrs@FreeBSD.org>, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r208876 - head/sys/netinet
Message-ID:  <alpine.BSF.2.00.1006081704270.47605@fledge.watson.org>
In-Reply-To: <20100607200743.GB4468@garage.freebsd.pl>
References:  <201006061611.o56GBHbE089883@svn.freebsd.org> <20100607200743.GB4468@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1006081704270.47605>