From owner-freebsd-current@FreeBSD.ORG Wed Aug 26 14:43:41 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 9C223106568C for ; Wed, 26 Aug 2009 14:43:41 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC508FC18 for ; Wed, 26 Aug 2009 14:43:41 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJfmlEqDaFvL/2dsb2JhbADZEYI1gWUF X-IronPort-AV: E=Sophos;i="4.44,279,1249272000"; d="scan'208";a="45635423" Received: from nile.cs.uoguelph.ca ([131.104.91.203]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 26 Aug 2009 10:43:39 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by nile.cs.uoguelph.ca (Postfix) with ESMTP id B0BC88D4144; Wed, 26 Aug 2009 10:43:39 -0400 (EDT) X-Virus-Scanned: amavisd-new at nile.cs.uoguelph.ca Received: from nile.cs.uoguelph.ca ([127.0.0.1]) by localhost (nile.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0RV800XfsyxH; Wed, 26 Aug 2009 10:43:38 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by nile.cs.uoguelph.ca (Postfix) with ESMTP id ACD448D413C; Wed, 26 Aug 2009 10:43:38 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n7QEmDL23819; Wed, 26 Aug 2009 10:48:13 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Wed, 26 Aug 2009 10:48:13 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Kostik Belousov In-Reply-To: <20090821200957.GC9623@deviant.kiev.zoral.com.ua> Message-ID: 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: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 14:43:41 -0000 On Fri, 21 Aug 2009, Kostik Belousov wrote: >> >> 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? 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? Thanks in advance for help with this, rick