cvs commit: src/sys/fs/pseudofs pseudofs_vnops.c

John Baldwin jhb at FreeBSD.org
Mon Aug 18 12:40:20 PDT 2003


On 18-Aug-2003 Dag-Erling Smørgrav wrote:
> John Baldwin <jhb at FreeBSD.org> writes:
>>   Log:
>>   The allproc lock is a sx lock, not a mutex, so fix the assertion.  This
>>   asserts that the sx lock is held, but does not specify if the lock is held
>>   shared or exclusive, thus either type of lock satisfies the assertion.
> 
> My bad - but why didn't I get a warning about the incorrect pointer
> type?  And why did the code run fine with INVARIANT_SUPPORT and
> INVARIANTS defined?  Just lucky?

It shouldn't have compiled in a static kernel, and the module should
have failed to load.  You did get a warning actually, that is how I
noticed this.  module builds don't error out on warnings though, only
kernel builds do.  Ah 'allproc' is the name of the actual linked
list head, so the module did load and link ok, it just examined the
head of the allproc list and treated that as a mutex.  I've no idea
why it worked.  Perhaps your kernel did not have INVARIANT_SUPPORT
defined in its config?

-- 

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


More information about the cvs-src mailing list