From owner-freebsd-current Mon Sep 9 17: 8:52 2002 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 D0B3D37B405; Mon, 9 Sep 2002 17:08:43 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C1BF43E65; Mon, 9 Sep 2002 17:08:43 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g8A08HOo004829; Mon, 9 Sep 2002 20:08:18 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 9 Sep 2002 20:08:17 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Don Lewis Cc: current@FreeBSD.org, jeff@FreeBSD.org Subject: Re: vnode lock assertion problem in nfs_link() In-Reply-To: <200209092300.g89N0Hwr093398@gw.catspoiler.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 9 Sep 2002, Don Lewis wrote: > nfs_link() contains the following code: > > /* > * Push all writes to the server, so that the attribute cache > * doesn't get "out of sync" with the server. > * XXX There should be a better way! > */ > VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_thread); > > The problem is that vp is not locked by the caller, but VOP_FSYNC() > expects its argument to be locked. > > I think we can probably just lock and unlock vp around the call to > VOP_FSYNC() ... What I'd actually like to do is lock vp on going in to the VOP. I need to grab the lock in the link() code anyway to do the MAC check. UFS and others all immediately lock the vnode on entry anyway... Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message