netgraph(4) initialization order

Maksim Yevmenkin maksim.yevmenkin at savvis.net
Wed Jan 5 13:31:08 PST 2005


[...]

>>> how about new attached patch?
>>>
>>
>> Exactly what I had in mind =-)  Have you tested this out to make sure
>>  it fixes the problem cases?
> 
> i'm building kernel now, but i'm almost certain it will fix the problem. 
> the stack trace i got points to ng_newtype() calling ng_findtype() that 
> wants to mtx_lock(ng_typelist_mtx). i'm pretty sure the ng_typelist_mtx 
> mutex was not initialized, that is ngb_mod_event() was never called.
> 
> panic: mtx_lock() of spin mutex (null) @ 
> /usr/src/sys/netgraph/ng_base.c:1189
> 
> no mutex name and ng_typelist_mtx is *not* a spin mutex.
> 
> ng_ubt(4) calls ng_newtype() from its mod_event handler, so i think 
> ng_ubt(4) mod_event handler was called before ngb_mod_event().

built new kernel (with netgraph and ubt compiled in) and rebooted the 
box. no crash. so patch works.

can i commit it?

thanks,
max


More information about the freebsd-current mailing list