From owner-freebsd-current Tue Sep 10 15:46: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 2B96237B401; Tue, 10 Sep 2002 15:46:14 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAF0643E72; Tue, 10 Sep 2002 15:46:13 -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 g8AMk5wr096324; Tue, 10 Sep 2002 15:46:09 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200209102246.g8AMk5wr096324@gw.catspoiler.org> Date: Tue, 10 Sep 2002 15:46:05 -0700 (PDT) From: Don Lewis Subject: vnode lock assertion problem in nfs_rename() To: current@FreeBSD.ORG, jeff@FreeBSD.ORG Cc: Robert Watson 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() ... There's a similar problem in nfs_rename(): /* * We have to flush B_DELWRI data prior to renaming * the file. If we don't, the delayed-write buffers * can be flushed out later after the file has gone stale * under NFSV3. NFSV2 does not have this problem because * ( as far as I can tell ) it flushes dirty buffers more * often. */ VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_thread); if (tvp) VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_thread); fvp is not locked by the caller. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message