From owner-cvs-src@FreeBSD.ORG Mon Aug 4 14:16:14 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4876F1065683; Mon, 4 Aug 2008 14:16:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8978FC1D; Mon, 4 Aug 2008 14:16:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m74EG8qb020531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Aug 2008 17:16:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m74EG8hS053982; Mon, 4 Aug 2008 17:16:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m74EG8Lj053981; Mon, 4 Aug 2008 17:16:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Aug 2008 17:16:07 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20080804141607.GX97161@deviant.kiev.zoral.com.ua> References: <200808031334.m73DY4fR030018@repoman.freebsd.org> <200808040919.08314.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7HHdeecsxVcUoH+o" Content-Disposition: inline In-Reply-To: <200808040919.08314.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern link_elf.c link_elf_obj.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2008 14:16:14 -0000 --7HHdeecsxVcUoH+o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 04, 2008 at 09:19:07AM -0400, John Baldwin wrote: > On Sunday 03 August 2008 09:33:45 am Konstantin Belousov wrote: > > kib 2008-08-03 13:33:45 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/kern link_elf.c link_elf_obj.c > > Log: > > SVN rev 181235 on 2008-08-03 13:33:45Z by kib > > > > Calling linker_load_dependencies() while holding the module' > > vnode lock may cause a LOR between kld_sx lock and vnode lock. > > linker_load_dependencies() drops kld_sx, and another thread may attem= pt > > to load the same kld. > > > > Reported and tested by: pjd > > MFC after: 1 week >=20 > If it is safe to drop the vnode lock here, is there any reason we can't j= ust=20 > drop it earlier and not bother reacquiring it? It is safe because the vnode is referenced by vn_open(), and lock reacquisition is done with LK_RETRY. After the linker_load_dependencies(), optional symbol table loading is performed, that requires reading from the module file. It seems to be a natural location for the operation. --7HHdeecsxVcUoH+o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkiXDyYACgkQC3+MBN1Mb4jGIwCfRcDcOkTzK9rORJNKnexxomx2 X2gAn3gNXC64+C4v/Jv5WIgfsfKBh/H9 =7lQw -----END PGP SIGNATURE----- --7HHdeecsxVcUoH+o--