From owner-cvs-all@FreeBSD.ORG Sat Sep 3 07:23:47 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6149916A41F; Sat, 3 Sep 2005 07:23:47 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from efnet-math.org (efnet-math.org [69.60.109.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id D79EA43D49; Sat, 3 Sep 2005 07:23:46 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.1.5] (host245-176.pool8257.interbusiness.it [82.57.176.245]) (authenticated bits=0) by efnet-math.org (8.13.1/8.13.1) with ESMTP id j837NYek006572 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sat, 3 Sep 2005 03:23:36 -0400 In-Reply-To: <20050902184655.C4631@10.0.0.1> References: <200509021549.j82Fnut9051619@repoman.freebsd.org> <20050902184655.C4631@10.0.0.1> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Suleiman Souhlal Date: Sat, 3 Sep 2005 09:23:18 +0200 To: Jeff Roberson X-Mailer: Apple Mail (2.733) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/nullfs null_vnops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2005 07:23:47 -0000 Hi, On Sep 3, 2005, at 3:48 AM, Jeff Roberson wrote: > I'm not sure that this is correct. The line: > lockmgr(vnlock, LK_RELEASE, NULL, curthread); > > Should unlock the lower node which vput would have already > unlocked. It must be done this way to properly adjust the vnlock ptr. I'm not sure I understand what you're saying. After this commit, the code is: vnlock = vp->v_vnlock; vp->v_vnlock = &vp->v_lock; lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL, curthread); if (lowervp) { vput(lowervp); } else lockmgr(vnlock, LK_RELEASE, NULL, curthread); Which I believe unlocks things in the right order. However, after discussing with kan@, we identified two races: - There is a short time between changing the pointer and locking vp->v_lock during which someone might steal the lock from us, so we should hold the interlock during these two operations. - Someone might be waiting on the lower vnode's lock, and when it is released, he might think that he has the vnode. I am unsure how this can be fixed. -- Suleiman Souhlal | ssouhlal@vt.edu The FreeBSD Project | ssouhlal@FreeBSD.org