From owner-freebsd-current@FreeBSD.ORG Mon Aug 30 05:30:10 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76D5216A4CE; Mon, 30 Aug 2004 05:30:10 +0000 (GMT) Received: from transport.cksoft.de (transport.cksoft.de [62.111.66.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39B1443D4C; Mon, 30 Aug 2004 05:30:10 +0000 (GMT) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from transport.cksoft.de (localhost [127.0.0.1]) by transport.cksoft.de (Postfix) with ESMTP id EDA9A1FF92F; Mon, 30 Aug 2004 07:30:07 +0200 (CEST) Received: by transport.cksoft.de (Postfix, from userid 66) id E5EC11FF91D; Mon, 30 Aug 2004 07:30:05 +0200 (CEST) Received: by mail.int.zabbadoz.net (Postfix, from userid 1060) id 28B6715682; Mon, 30 Aug 2004 05:29:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.int.zabbadoz.net (Postfix) with ESMTP id 1DC5C15329; Mon, 30 Aug 2004 05:29:56 +0000 (UTC) Date: Mon, 30 Aug 2004 05:29:56 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@e0-0.zab2.int.zabbadoz.net To: Robert Watson In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS cksoft-s20020300-20031204bz on transport.cksoft.de cc: Gleb Smirnoff cc: FreeBSD current mailing list Subject: Re: mutex Giant not owned at /usr/src/sys/kern/vfs_vnops.c:120 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2004 05:30:10 -0000 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