Date: Mon, 30 Aug 2004 05:29:56 +0000 (UTC) From: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> To: Robert Watson <rwatson@freebsd.org> Cc: FreeBSD current mailing list <current@freebsd.org> Subject: Re: mutex Giant not owned at /usr/src/sys/kern/vfs_vnops.c:120 Message-ID: <Pine.BSF.4.53.0408300526540.80509@e0-0.zab2.int.zabbadoz.net> In-Reply-To: <Pine.NEB.3.96L.1040830002424.1492A-100000@fledge.watson.org> References: <Pine.NEB.3.96L.1040830002424.1492A-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 30 Aug 2004, Robert Watson wrote:
G'morning,
> Could you try the following patch:
seems to work fine; my test program crashes somewhen later cause of
some pthread probelm but modules got loaded successfully w/o panic.
> Index: ng_socket.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/netgraph/ng_socket.c,v
> retrieving revision 1.53
> diff -u -r1.53 ng_socket.c
> --- ng_socket.c 31 Jul 2004 21:32:55 -0000 1.53
> +++ ng_socket.c 30 Aug 2004 04:17:38 -0000
> @@ -300,7 +300,9 @@
>
> /* Not found, try to load it as a loadable module */
> snprintf(filename, sizeof(filename), "ng_%s", mkp->type);
> + mtx_lock(&Giant);
> error = linker_load_module(NULL, filename, NULL, NULL, &lf);
> + mtx_unlock(&Giant);
> if (error != 0) {
> FREE(msg, M_NETGRAPH_MSG);
> goto release;
>
> This causes Giant to be acquired in the event we enter the linker code
> (and hence VFS code) via netgraph ngc_send(). It should be safe in this
> context as we enter protocol send routines without mutexes held (i.e., why
> we're also able to do blocking memory allocation here.)
please commit.
> Thanks!
many thanks to you! :-)
--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.53.0408300526540.80509>
