From owner-freebsd-current Mon Sep 9 16: 5:28 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 4DBCE37B400; Mon, 9 Sep 2002 16:05:26 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id D828643E4A; Mon, 9 Sep 2002 16:05:25 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g89N5Gwr093422; Mon, 9 Sep 2002 16:05:20 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200209092305.g89N5Gwr093422@gw.catspoiler.org> Date: Mon, 9 Sep 2002 16:05:16 -0700 (PDT) From: Don Lewis Subject: Re: vnode lock assertion problem in nfs_link() To: current@FreeBSD.ORG, jeff@FreeBSD.ORG Cc: current@FreeBSD.ORG, jeff@FreeBSD.ORG In-Reply-To: <200209092300.g89N0Hwr093398@gw.catspoiler.org> 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 9 Sep, 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() ... Hmn, I think I just figured out this bit of code in ufs_link(): if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) { goto out2; } It would probably be a bad thing to unconditionally lock vp if vp and tdvp are the same ... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message