cvs commit: src/sys/netgraph ng_base.c

John Baldwin jhb at freebsd.org
Mon Jun 5 12:32:55 UTC 2006


On Monday 05 June 2006 03:33, Gleb Smirnoff wrote:
> On Fri, Jun 02, 2006 at 08:35:39PM +0000, John Baldwin wrote:
> J> jhb         2006-06-02 20:35:39 UTC
> J> 
> J>   FreeBSD src repository
> J> 
> J>   Modified files:
> J>     sys/netgraph         ng_base.c 
> J>   Log:
> J>   Conditionally acquire Giant in netgraph callouts to honor mpsafenet=0.
> J>   
> J>   Reported by:    sekes <gexlie at gmail dot com>
> J>   MFC after:      1 week
> J>   
> J>   Revision  Changes    Path
> J>   1.123     +2 -0      src/sys/netgraph/ng_base.c
> 
> I don't think this is best way to fix this. I'd suggest to back this
> out and make this change:
> 
> Index: netgraph.h
> ===================================================================
> RCS file: /home/ncvs/src/sys/netgraph/netgraph.h,v
> retrieving revision 1.65
> diff -u -r1.65 netgraph.h
> --- netgraph.h  12 Jan 2006 22:44:04 -0000      1.65
> +++ netgraph.h  5 Jun 2006 07:32:43 -0000
> @@ -1101,7 +1101,7 @@
>  int    ng_uncallout(struct callout *c, node_p node);
>  int    ng_callout(struct callout *c, node_p node, hook_p hook, int ticks,
>             ng_item_fn *fn, void * arg1, int arg2);
> -#define        ng_callout_init(c)      callout_init(c, CALLOUT_MPSAFE)
> +#define        ng_callout_init(c)      callout_init(c, NET_CALLOUT_MPSAFE)
>  
>  /* Flags for netgraph functions. */
>  #define        NG_NOFLAGS      0x00000000      /* no special options */
> 
> If you don't object, I can backout and commit the above myself.

Ok, didn't know that we had that flag.  That won't work when mpsafenet changes 
to 0 mid-flight b/c one kldload's a non-mpsafe module though. :)  Of course, 
we already don't support that because NET_LOCK_GIANT doesn't return a locked 
variable that is passed to NET_UNLOCK_GIANT like VFS_LOCK_GIANT does.

-- 
John Baldwin


More information about the cvs-src mailing list