From owner-freebsd-current@FreeBSD.ORG Wed Aug 26 20:26:40 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90F90106564A for ; Wed, 26 Aug 2009 20:26:40 +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 DFF458FC20 for ; Wed, 26 Aug 2009 20:26:39 +0000 (UTC) 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 n7QKQYCf089567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Aug 2009 23:26:34 +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.3/8.14.3) with ESMTP id n7QKQYRL069557; Wed, 26 Aug 2009 23:26:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n7QKQX1J069556; Wed, 26 Aug 2009 23:26:33 +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: Wed, 26 Aug 2009 23:26:33 +0300 From: Kostik Belousov To: Rick Macklem Message-ID: <20090826202633.GF9623@deviant.kiev.zoral.com.ua> References: <20090819161817.GA89704@keira.kiwi-computer.com> <20090819175029.GA90205@keira.kiwi-computer.com> <20090821200957.GC9623@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xcdXf2pmdJ8FA+Zb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 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: "Rick C. Petty" , bzeeb+freebsd+lor@zabbadoz.net, current@freebsd.org Subject: Re: various vfs LORs X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 26 Aug 2009 20:26:40 -0000 --xcdXf2pmdJ8FA+Zb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 26, 2009 at 10:48:13AM -0400, Rick Macklem wrote: >=20 >=20 > On Fri, 21 Aug 2009, Kostik Belousov wrote: >=20 > >> > >>Since the 3rd one is locking a newly allocated nfs vnode (that isn't yet > >>in the mount point list, etc), I don't think this will cause a problem > >>and I don't see an easy way to avoid it. > > > >We could add LK_NOWITNESS to nfsclient/nfs_subr.c:161. > > > Ok, I had thought LK_NOWITNESS was used for lockinit() and applied to > the lock "forever" so it didn't seem like a good idea, but I just > looked and it appears that LK_NOWITNESS can be used for > vn_lock()/lockmgr() to apply to that lock call only? >=20 > If so, this seems reasonable, so long as my analysis that it doesn't > matter because it is a new nfs vnode (guaranteed to not yet be locked) > and, as such, can't cause a deadlock. (I'm assuming that LORs are checked > to try and avoid deadlocks or other nasties like sleeping for a sleep lock > when a mutex is held.) Sound right? Yes, sounds right. You could see similar workaround in devfs, fs/devfs/devfs_vnops.c:404, also in the place where new vnode is instantiated. --xcdXf2pmdJ8FA+Zb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkqVmnkACgkQC3+MBN1Mb4gNhACgqehA5vgHKQVBmFl0u0Pg2x0y 6bsAoLjCJeGSOXRjvdWBaSlF5JNwUQj6 =a+Sc -----END PGP SIGNATURE----- --xcdXf2pmdJ8FA+Zb--