Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2002 02:03:05 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Alfred Perlstein <alfred@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Peter Wemm <peter@wemm.org>
Subject:   Re: cvs commit: src/sys/netgraph ng_socket.c src/sys/alpha/osf1
Message-ID:  <XFMail.020114020305.jhb@FreeBSD.org>
In-Reply-To: <20020113182247.A7984@elvis.mu.org>

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

On 14-Jan-02 Alfred Perlstein wrote:
> Invariants wants me to bzero the mutex before initializing it otherwise
> it freaks out because it sees what _looks_ like an already initialized 
> mutex...
> 
> lame...

If you have a better idea that's not O(n) for seeing if a lock is already
initialized...  Note that many things that hold locks are allocated with M_ZERO
already (softc's for example), so it's not all that big of a requirement.

> Rev 1.61 should fix it for you:
> 
> don't initialize the mutex in the temporary struct file, the soo_*
> functions just grab f_data and don't muck with anything else so this
> should be ok.
> 
> this fixes a panic with invariants where it thinks we've doubly initialized
> the filetmp mutex even though all we've done is neglect to bzero it.

This sounds like using a struct file is wrong in teh first place and is really
a hack.  You should just be passing the socket to functions directly.  But that
would require a bit more work to cleanup the interface I guess.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.020114020305.jhb>